Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Flowchart maximum links and nodes   (Read 8051 times)
mrreddy82
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Sep 30th, 2009
Flowchart maximum links and nodes  
Sep 30th, 2009 at 1:15pm
Print Post  
When I try to load 15,000 nodes with 15,000 links it is giving stack overflow exception 
Same code is working for other projects with 2000 links and nodes
Is there any limit ?
If yes, how many?
If no, could someone please give me the solution …………
Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #1 - Sep 30th, 2009 at 2:55pm
Print Post  
Hi,

Could you copy here the code that loads the items?
  
Back to top
 
IP Logged
 
mrreddy82
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Sep 30th, 2009
Re: Flowchart maximum links and nodes  
Reply #2 - Sep 30th, 2009 at 4:44pm
Print Post  
private void RecurseActivity(CustomShapeNode currentNetworkGraphNode)
       {
           //Recurse all children
           foreach (MpLink lnkPre in ((MpActivity)currentNetworkGraphNode.Tag).ToConstraints)
           {
               CustomShapeNode predecessorNetworkGraphNode = null;

               //Only create the node if the node is not already created
               if (!CreatedNodes.ContainsKey(lnkPre.FromMpActivity) || CreatedNodes[lnkPre.FromMpActivity] == null)
               {
                   predecessorNetworkGraphNode = CreateShapeNode(lnkPre.FromMpActivity, NodeType.child, false);
                   CreatedNodes.Add(lnkPre.FromMpActivity, predecessorNetworkGraphNode);
               }
               else
               {
                   foreach (DiagramNode n in NetworkDiagram.Nodes)
                   {
                       if (((CustomShapeNode)n).Tag == lnkPre.FromMpActivity)
                       {
                           predecessorNetworkGraphNode = (CustomShapeNode)n;
                           break;
                       }
                   }
               }
               //Add a relation between the new child and the currentnode (only happens if no relation exist)
               if (CreateLink(predecessorNetworkGraphNode, currentNetworkGraphNode, lnkPre))
                   RecurseActivity(predecessorNetworkGraphNode);
           }

           //recurse all parents
           foreach (MpLink lnkSuc in ((MpActivity)currentNetworkGraphNode.Tag).FromConstraints)
           {
               //create the parentnode
               CustomShapeNode successorNetworkGraphNode = null;

               if (!CreatedNodes.ContainsKey(lnkSuc.ToMpActivity) || CreatedNodes[lnkSuc.ToMpActivity] == null)
               {
                   successorNetworkGraphNode = CreateShapeNode(lnkSuc.ToMpActivity, NodeType.parent, false);
                   CreatedNodes.Add(lnkSuc.ToMpActivity, successorNetworkGraphNode);
               }
               else
               {
                   foreach (DiagramNode n in NetworkDiagram.Nodes)
                   {
                       if (((CustomShapeNode)n).Tag == lnkSuc.ToMpActivity)
                       {
                           successorNetworkGraphNode = (CustomShapeNode)n;
                           break;
                       }
                   }
               }
               //add the relation between the current node and the new parent (only happens if no relation exist)
               if (CreateLink(currentNetworkGraphNode, successorNetworkGraphNode, lnkSuc))
                   RecurseActivity(successorNetworkGraphNode);
           }
       }
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #3 - Sep 30th, 2009 at 7:03pm
Print Post  
I think the CLR has a fixed call-stack size, and this recursive function might be reaching the limit. You might try rewriting this code using a loop that continues while some Stack<DiagramNode> is not empty, and pushes the nodes currently passed as function arguments into that stack rather than calling a recursive function.
  
Back to top
 
IP Logged
 
mrreddy82
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Sep 30th, 2009
Re: Flowchart maximum links and nodes  
Reply #4 - Sep 30th, 2009 at 7:28pm
Print Post  
Thanks for your replay!!!!!!!

So, you mean there is no maximum limit for nodes and links in flowchart diagram, right?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #5 - Oct 1st, 2009 at 7:51am
Print Post  
There isn't a built-in restriction; only the control won't be very responsive with that many items, and you'll probably start getting some out-of-memory exceptions at some point 8)
  
Back to top
 
IP Logged
 
mrreddy82
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Sep 30th, 2009
Re: Flowchart maximum links and nodes  
Reply #6 - Oct 8th, 2009 at 2:29pm
Print Post  
Hi Stoyo,
I tried with stack mechanismus, now there is no problem while adding the nodes to diagram.
But, I am getting the same error while arranging in flowchart diagram I tried with all layouts it is not working .
Same thing is working for around 7000 nodes and links to arrange in layouts

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #7 - Oct 8th, 2009 at 4:23pm
Print Post  
Yep, the control uses a lot of recursive functions too while preparing the graph for layout. We'll see if we can change them to use an external stack for the next release.

Stoyan
  
Back to top
 
IP Logged
 
mrreddy82
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Sep 30th, 2009
Re: Flowchart maximum links and nodes  
Reply #8 - Oct 8th, 2009 at 6:33pm
Print Post  
Oky,
Could you please tell me how to catch that exception
I used the try catch block it is not working
Thanks in advance !!!

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #9 - Oct 12th, 2009 at 11:10am
Print Post  
You can't handle a StackOverflowException; apparently the runtime cannot unwind the stack to reach your handler in that case.

Until we implement this using an external stack, you might try to use this EDITBIN tool to increase the call-stack size for the executable.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Flowchart maximum links and nodes  
Reply #10 - Nov 4th, 2009 at 11:10am
Print Post  
We've tried to reproduce this on a graph with 20K nodes but couldn't. Could you post here the layout settings you are using, and if possible email us a sample graph of yours saved as xml?

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