-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Memory Leak in Network Visualization #3439
Comments
Are you loading images into nodes? There's a known possibility of leakage there. In any case, an example network would be useful here. Edit: Holy crap 10K+ nodes in network. OK, so an example might be hard to come by. Still hoping, though. |
Another question: Are you using smooth type Reason for this: |
Thanks for the fast reply @wimrijnders. We are not exactly using the value And you are right about the edges, we have set:
which defaults to I'll try your suggestion to use |
OK. With images, I know that there is leakage possible, which in fact is preventable. I do not believe that the same applies to icons. There must be another thing going on. |
I played around with the chrome performance profiles for a while; there's lots of information there, most of which I currently partly understand. But I can see the potential for using this for performance optimization. TIL. But now I do realize that the nodes and listeners mentioned in the image above are not the same thing as nodes and listeners within With respect to analyzing the memory leaks, I think the thing to do here is to see what remains after |
You must have a huge network loaded BTW. I'm testing here with a 1250-node network and the performance-screen only shows a maximum of 84 nodes and 21 listeners. Is there any chance of a minimal example to recreate the characteristics of the graph above? That would be a starting point. |
Hi @wimrijnders, I also find that performance tab super useful, it's a life saver in cases like this. Sorry for misleading you with the nodes information, it might be indeed not very useful for this kind of analysis. On the other hand, I usually find the listeners count useful because (from my understanding) after a proper clean-up it should go back to the value it was before. I've applied your advice to change the property As you can see in the image, in terms of memory itself there is minimal leakage now. There is still, however, several listeners that are still alive, You might notice that there are less nodes and listeners now. The graph data is the same as before, but this time I had the graph opened just once to keep the results simpler. It contains 377 nodes and 726 edges. I'll see if I can set some sort of Plunker to help on this investigation. |
👍 Great feedback! Thanks for running the test. While it's still mostly vague to me, there is one outstanding conclusion: the hidden nodes are not cleaned up properly. It's good to have a confirmation of this. Having said that, there are fixes in the current develop-branch which address the cleanup of nodes/edges......#3330 (had to search a bit). A next obvious step is thus to see if latest develop handles this better:
The second option is a bit more work for me, but I think it will be more telling. Do you agree? It means you'll have to run the original test again with latest build, I hope that that's OK with you. |
Sure, I can try with develop. But don't worry, if the steps on the README are up to date I can build it myself. I'll let you know if I face some issues or I'll come back with the results. |
Ah OK, you have your own cloned repo? If so, so much the better. (I really appreciate all participatory efforts of users in issues; sincerely thank you) |
Sure, no problem, I'm glad to help. Are there any breaking changes on develop?
I wrapped the inner loop in Anyways, getting back to the performance issue, there is no significant difference to what has been seen in version While analyzing the differences between the parameters for the edges smoothing, I noticed that my graph no longer goes through the stabilization process when using 'continuous', since events like The relevant parts of my configuration object look like the following: {
nodes: {
physics: false,
},
edges: {
smooth: {
enabled: true,
type: 'continuous',
},
width: 0
},
layout: {
improvedLayout: true,
},
physics: {
enabled: true,
stabilization: {
enabled: true,
onlyDynamicEdges: true,
fit: false,
},
},
} |
If I change Edit: Probably because the stabilization runs again. |
@fatore I appreciate the feedback, but I can't seem to get around to handling it, sorry. But I regard this as important and will be back. |
@wimrijnders, that's ok. Your suggestion to use 'continuous' for the smoothing already helped. Thank you for your time. |
But the 'conclusion' I made that it had to do with the hidden nodes is clearly false. So this needs further investigation. As Arnold said, "I'll be back". |
That's a bug that's also recently been reported in #3464. Working on it now. I should have been more observant, you reported it first.
No the stabilization is always run. However, there is a stop criterium in stabilization. Sort of like 'is this good enough? If so, let's stop'. It appears that this criterium is reached really soon with
Aaah, physics was off. Then indeed stabilization does not run automatically.
My pleasure. If you feel we are done here, please close the issue. But I'm not done yet; examining the leakage with stabilization+dynamic is now on my TODO. |
Sure. Thanks again for the conclusion. I'll be looking forward updates. |
As it can be seen in the attached image, I've found significant leaking in the network visualization. By the end of my component life-cycle I have a block like this:
However, that doesn't seem to be enough to clean all the bound listeners, causing the leaking.
I would appreciate if someone could provide some guidance on how to properly clean the network visualization or acknowledge this as a bug.
The text was updated successfully, but these errors were encountered: