Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Applet mode hangs when editing multiple items (Read 9510 times)
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Applet mode hangs when editing multiple items
Feb 19th, 2009 at 1:32am
Print Post  
Hello,

Our company has implemented an interactive network UI using NetDiagram in an Applet mode.

The process of creating the network is

1. Get the details for the nodes from the DB
2. Get the details for the links from the DB
3. Draw the nodes and then links
4. Layout the diagram using LayeredLayout
(The links are drawn in Cascading mode as bezier lines are supported by LayeredLayout)
5. Recreate links using bezier type.

This all works well. However, when we try to move a node from it's location to another location in order to make some link overlaps clearer, it works well at first or second time but after moving several nodes or when we try to move multiple nodes at once, the CPU usage goes to 100% and the UI hangs.

At this point, we have to shutdown the IE and restart...

Solution to any of the following questions may help the situation...

1. Is there any way to prevent this or get around this?

2. Can bezier line type be supported in layeredlayout?

3. Is there a way to define minimum distance between the links in a layeredlayout?

I can send you some screen shots if that would help in better explaning what's going on...

Thank you,



  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #1 - Feb 19th, 2009 at 8:49am
Print Post  
Hi,

Are you using auto-routing, or applying the layout again from some event handler? Are there any messages in the Java console?

Stoyan
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #2 - Feb 19th, 2009 at 3:18pm
Print Post  
Hi,

I am using the auto-routing. All rerouting calculation is done within the applet without postback.

Thank you,

James
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #3 - Feb 19th, 2009 at 3:43pm
Print Post  
Perhaps it is routing links during that time? Are you explicitly calling the links' Route() method from an event handler, or relying on the AutoRoute attribute?

Try running the following in the applet_ started handler to see if it finishes in shorter time:

var ro = diagram.getRoutingOptions();
ro.setDontOptimizeLonkroutes(true);
ro.setGridSize(ro.getGridSize() * 2);

Stoyan
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #4 - Feb 19th, 2009 at 5:48pm
Print Post  
I must be missing something. It is saying the "diagram" is undefined.
I have been working with view defined by
var view = document.getElementById('diagramView').getDiagramView();

Can you help me with getting the "diagram" object?

Thank you,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #5 - Feb 19th, 2009 at 6:06pm
Print Post  
Add var diagram = view.getDiagram().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #6 - Feb 27th, 2009 at 9:58pm
Print Post  
Thank you. It seems to be resolving the issue. I will report back after we have solid result of the changes.
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #7 - Mar 13th, 2009 at 5:26pm
Print Post  
I may have found a root cause for this.
Everytime the user moves a node around with autorouting enabled, the memory use increases.

Java Plug-in 1.6.0
Using JRE version 1.6.0 Java HotSpot(TM) Client VM

Memory: 60,728K  Free: 15,930K  (26%) ... completed.
Memory: 82,388K  Free: 15,325K  (18%) ... completed.
Memory: 82,388K  Free: 40,189K  (48%) ... completed.
Memory: 82,388K  Free: 16,481K  (20%) ... completed.
Memory: 83,156K  Free: 25,473K  (30%) ... completed.
Memory: 144,592K  Free: 48,056K  (33%) ... completed.

Until it hangs with the following error.

Exception in thread "AWT-EventQueue-23" java.lang.OutOfMemoryError: Java heap space
...... (Deleted to make it short)
java.lang.NullPointerException  at com.mindfusion.diagramming.DiagramView.a(Unknown Source)  at com.mindfusion.diagramming.DiagramView$MouseMonitor.mouseDragged(Unknown Source)  at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)  at ....... (Deleted to make it short)

Can you please let me know what can be done to prevent this? What am I doing wrong?

Regards.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #8 - Mar 14th, 2009 at 9:32am
Print Post  
You might have to set even larger RoutingOptions.GridSize if your diagram is very large. E.g. if there is a very long link that goes from one corner of document.Bounds to the opposite corner, the routing function will create a grid with (bounds.width / routingoptions.gridsize) columns and (bounds.height / routingoptions.gridsize) rows. Each item in the grid needs a few bytes to store some flags and costs used by the routing algorithm.
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #9 - May 12th, 2009 at 4:06pm
Print Post  
We have yet been able to remove this problem. The memory usage increases every time a drawing is redrawn (has the same amount of nodes and links) because something was manually moved on the client side to another location to make it easier to read as lines still overlap for complex graphs after layered layout is executed.

Is this a sign of memory leaking or is this expected? If so why is the memory use getting larger?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #10 - May 15th, 2009 at 7:56am
Print Post  
Are you using the default routing options, and does that happen with the same diagram you emailed us for the layout settings post?
« Last Edit: May 15th, 2009 at 9:00am by Stoyo »  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #11 - May 15th, 2009 at 2:10pm
Print Post  
No. We are not using the default layout settings for the links as it is very difficult to follow what is linked to what. We are redrawing the links as bezier line types after the auto layout.

So the process is
1. Draw nodes
2. Draw links
3. Do layered layout
4. For each link, replace it with Bezier line type (with autoreroute on)

Thank you,
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Applet mode hangs when editing multiple items
Reply #12 - May 27th, 2009 at 6:50am
Print Post  
By testing multiple alternatives, I think if the following can be achieved, the performance can hugely be improved.

1. have a way to set IgnoreNodeSize = false for LayeredLayout

2. have a way to use Polyline as link type for LayeredLayout.

Is this something that can achieved?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applet mode hangs when editing multiple items
Reply #13 - May 27th, 2009 at 10:50am
Print Post  
Do you mean you need the IgnoreNodeSize property in the applet's LayeredLayout class? We'll try to implement it next week.

Regarding the routing problems - we have developed a new link routing algorithm that requires less memory than the current one, and should work faster. It's C# implementation is ready, and we'll port it to Java soon.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint