Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic "Out of memory" exception (Read 5015 times)
martink
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jan 4th, 2014
"Out of memory" exception
Feb 12th, 2014 at 8:22pm
Print Post  
Hello,

I have a TreeLayout layout with no more than 100 nodes (shapes) and I get "Out of memory" exception. Is there some kind of optimization I need to do. I saw some previous posts about this "Out of memory" issue (http://mindfusion.eu/Forum/YaBB.pl?num=1364247675 and http://mindfusion.eu/Forum/YaBB.pl?num=1392052251/4#4) but it seems to me the scenarios are different (e.g. LayeredLayout instead of TreeLayout, hence no EnforceLinkFlow property found). Are there some best practices so I won't hit this limitation until the nodes are too many (let say 1000)? Should I use a certain ClientSideMode or a feature created especially for that case?

Thanks in advance,
Martin
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: "Out of memory" exception
Reply #1 - Feb 13th, 2014 at 7:18am
Print Post  
Hi,

Is there any TreeLayout code shown in the stack trace for the exception? If you use ImageMap mode, it's more likely the exception comes from the GDI+ API when the diagram bitmap becomes very large. If that's the case, set the DiagramView.MaxImageSize property.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
martink
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jan 4th, 2014
Re: "Out of memory" exception
Reply #2 - Feb 13th, 2014 at 7:56pm
Print Post  
Hi Stoyan,

Thanks for your answer. I am using the "JavaApplet" client side mode (latest version). Attached is a screenshot with the Stack Trace. Any advice is welcomed.

Regards,
Martin
  

OutOfMemory.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: "Out of memory" exception
Reply #3 - Feb 14th, 2014 at 7:38am
Print Post  
Hi,

This call stack contains only yours and System.Drawing code. It seems the DrawSystemsDiagram method tries to load a large bitmap, and the bitmap constructor throws an exception? Largest bitmaps that GDI+ can handle are about 3000 by 3000 pixels, and that same exception is the reason we have the MaxImageSize property. Are you trying to set that bitmap as a background image for the diagram?

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
martink
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jan 4th, 2014
Re: "Out of memory" exception
Reply #4 - Feb 14th, 2014 at 9:18am
Print Post  
Hi Stoyan,

May I ask you to take a look at the DrawSystemsDiagram method - it is attached. I believe this "out of memory" issue is the last blocker that I have. Once my client verifies the solution, I will buy your licence. Your components are really good and your support is outstanding.

Thanks,
Martin
  

DrawSystemsDiagram_method.txt (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: "Out of memory" exception
Reply #5 - Feb 14th, 2014 at 9:46am
Print Post  
Hi,

Is that diagram_systems.png file very big? Even if it's not big, it might take a lot of memory if you assign it to many nodes. Note that each Bitmap instance you create in the "For Each systemTransf" loop has its own copy of the bitmap bytes. Instead of creating a new Bitmap for each node, try assigning a single shared Bitmap object to all nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
martink
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jan 4th, 2014
Re: "Out of memory" exception
Reply #6 - Feb 14th, 2014 at 10:03am
Print Post  
Hi,

The size of diagram_systems.png is 4KB. I will follow your advice about the bitmaps optimization and will let you know what the result is.

Thanks,
Martin
  
Back to top
 
IP Logged
 
martink
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jan 4th, 2014
Re: "Out of memory" exception
Reply #7 - Feb 15th, 2014 at 3:42pm
Print Post  
Hi Stoyan,

I followed your advice and the issue is fixed.

Thanks,
Martin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint