Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2k stars 415 forks source link

New memory issue with large node networks #165

Closed Physicalpariah closed 5 years ago

Physicalpariah commented 6 years ago

Seems like the new culling feature introduced a bunch of new foreach loops (and seemingly some other kind of memory blockage)

I tried to isolate it specifically, but a combination of time + unity being unresponsive meant I had to give up my hunt.

Memory + CPU usage are more than enough to crash a modern imac with 16gb ram.

Here's a few instances of new foreach loops:

NodeInspector.cs l:54 CanvasCalculator.cs l:63 XMLImport 39 52 65 76 93 111 123 181 194 222 235 259 271 283 RTCanvasCalculator.cs 45 50

Hope this helps.

Physicalpariah commented 6 years ago

Sorry, mis-pressed.

Seneral commented 6 years ago

Hm, culling definitely shouldn't cause it, it's just a pre-drawing condition checking whether the node is visible. The foreach loops you listed are not new and also are not critical (called just occasionally or not at all). Definitely not enough garbage to crash a machine. Just how many nodes do you have in the editor?

Physicalpariah commented 6 years ago

300-500 depending on the scene. You're right, its not the foreach loops, I'll see if I can whip up a test scene this weekend to better debug the issue.

Seneral commented 5 years ago

Leaving this to the other issue and going to refactor the recursive search algorithms