I'm working on a sort of roguelike, so using procgen, and I've hit a wall where the game crashes with an "out of memory" error.
Now, since this is still all a WIP I haven't been super careful about memory usage, so it's certainly possible... but when I print the result of stat(0) to the screen, the highest it ever goes is 200 before the crash. Thinking there might be some sort of recursion issue, I logged a couple trace() statements and that turned up a dead end...
Since I don't get a stack trace at the crash, and I have nothing else to go on... My question is: how do I go about troubleshooting this & how do I find the source of the problem? I'm not quite ready to share the cart yet, so I'm less looking for a specific solution and more general guidelines. What should I look for, and where?
that seemed to help! ...a little bit. It's still crashing, occasionally, but less frequently than before. And now I have something to look for, even though it's still not super clear when or why it's running out of memory.
The output of stat(0)... shouldn't it be a lot higher than I'm seeing?
In situations like this, I would recommend you to try to comment out parts of the code to nail down which is causing this memory leak. It should be easier to solve once you figured that part out...
[Please log in to post a comment]