NeuralPatterns icon indicating copy to clipboard operation
NeuralPatterns copied to clipboard

Memory leak caused by resetting environment.

Open ghost opened this issue 3 years ago • 0 comments

It appears that every time the environment is restarted an additional 4 MB of memory is allocated without cleaning up the previous simulation. image

Here's a snapshot of memory usage for the tab itself to demonstrate how easy it is to end up with GBs being allocated when restarting the environment a few times. image

Due to the fact that fixing the leak itself may not be an option due to it being a problem with WebGL I theorize that a somewhat hacky fix is to rewrite Utils.generateState() by using the same logic the brush uses to clear the environment and to place the cells using that to recreate the same effect without having to make a whole new buffer.

ghost avatar Mar 18 '22 22:03 ghost