elk icon indicating copy to clipboard operation
elk copied to clipboard

40000+ node layout, out of memory

Open acklj1 opened this issue 2 years ago • 1 comments

I use java run 40000+ node layout

    "contentAlignment": "[V_CENTER]",
    "edgeRouting": "ORTHOGONAL",
    "org.eclipse.elk.hierarchyHandling": "INCLUDE_CHILDREN",
    "org.eclipse.elk.layered.layering.strategy": "NETWORK_SIMPLEX",
    "separateConnectedComponents": true,
    "spacing.componentComponent": 80,
    "spacing.edgeEdge": 20,
    "spacing.edgeEdgeBetweenLayers": 20,
    "spacing.edgeNode": 50,
    "spacing.edgeNodeBetweenLayers": 40,
    "spacing.nodeNode": 80,
    "spacing.nodeNodeBetweenLayers": 152

I run in java, use BasicProgressMonitor

    final BasicProgressMonitor pm = new BasicProgressMonitor();
    new RecursiveGraphLayoutEngine().layout(elkGraph, pm);

java vm options:

    -Xms512m -Xmx8192m -Xmn4096m -Xss4m

and then out of memory

    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

acklj1 avatar Dec 29 '23 10:12 acklj1

Why do you need hierarchyHandling: INCLUDE_CHILDREN? Do you have edges that cross hierarchy levels? Have you considered introducing these edges explicitly by splitting them with ports since this vastly reduces the complexity. If you have 40000 nodes, I do not think that you require the capabilities for crossing minimization across hierarchies this option provides.

Could you please provide me with the graph such that I could investigate what phases causes this error?

Another option is to try simpler options for all layout phases. Generally, I could however say that the layered algorithm not always perfect to layout very big graphs. What is the nature of these graphs? Do you actually require a complex layout considering alignment and edge crossings or are you just using this to get coordinates that could be trivially computed? I.e., do you know where these nodes should be placed beforehand?

soerendomroes avatar Jan 03 '24 16:01 soerendomroes