Nightmod icon indicating copy to clipboard operation
Nightmod copied to clipboard

Possible memory leak?

Open MysteryMachine opened this issue 10 years ago • 3 comments

On my computer, opening Nightmod and opening the default Arcade project, if I hold Command+R to trigger various resets, I can see memory usage go up pretty rapidly. I had memory usage go up from 450mb to 760mb after holding for a few seconds. Is this a memory leak?

MysteryMachine avatar Jan 25 '15 22:01 MysteryMachine

I can reproduce this. I'll try to dig into it when I get the chance. I wonder if it happens slowly over normal use, or if it only happens when you hold down Cmd+R (if it's the latter, then there may be some kind of race condition preventing proper clearing of memory).

oakes avatar Jan 31 '15 03:01 oakes

I'm pretty sure it happens over normal use. Over 2-3 days, I developed on it without closing it. My computer started chugging, and I check activity monitor, and I noticed 2 gbs of memory were being used. I suppose that doesn't entirely weed out it being some sort of race condition. Maybe on a normal press of cmd+r, it fires 3-4 times on the few frames your finger is holding the command?

MysteryMachine avatar Jan 31 '15 04:01 MysteryMachine

Haven't been able to track this down yet, unfortunately. I tried disabling the sandbox, and it still happens. I tried deleting all the code from a project, and it still happens. I ran VisualVM to inspect it while it runs, and didn't see anything conclusive. I'll keep working on it but it may not be fixed in the next release.

oakes avatar Feb 09 '15 01:02 oakes