Pause before out of memory crash on Chrome

I have a fairly simple graph diagram, full of position nodes, with gemoetry strings for each node, four node template maps, 2 link template maps, and about 50 - 100 nodes in total. This diagram opens in a modal dialog.

Whenever I open a graph which involves linking of nodes (nodes are linked only in some scenarios), 3 time I close and open the graph, my debugger tools in Chrome pauses some where in go.js with the warning “Paused before potential out-of-memory crash” and then when I proceed, the browser crashes with the Aw Snap error.

I am aware of the thread on how to GC properly a GoJS graph. I am setting diagram.div to null, diagram.clear and diagram.model.clear … but that does not help.

On root causing it I found out that if I use routing: go.Link.AvoidsNodes and curve: go.Link.JumpOver … thats when the graph takes a long time to load, and then eventually goes into memory leak when I close and open the same graph three times. If I use Orthogonal routing there is no issue.

Am I doing something wrong, or missing something here ?


Although this is unlikely to be browser-specific, have you tried it in other browsers?

I’m wondering if there is a way for us to reproduce the problem. Can you cause any of the sample apps to fail in this way?

So you are not just replacing the Diagram.model in order to load a new diagram – you are actually discarding the Diagram by disassociating it from the DIV. I suppose we can try various things tomorrow.

Are you sure you don’t have any references to the Diagram? If you have called Diagram.addDiagramListener or Diagram.addChangedListener without calling the corresponding removeXYZListener with the identical reference to the listener function, that could cause a memory leak.