Closed mitch3a closed 10 years ago
Could be a memory leak somewhere, this tool might help (I tried using it while changing main loop / gfx stuff) http://visualvm.java.net/
It looks like the heap size keeps getting bigger and until the GC needs to do a ton of work then BWAMPPPP... so reducing the heap size actually makes this better to cause little GCs that aren't as performance destructive. Also, might want to make sure we aren't allocating memory unnecessarily. This article is pretty good: https://code.google.com/p/libgdx-users/wiki/ForceGarbageCollection . Installing the IBM Monitoring and Diagnostic Tools for Java.
We need to be as good as we can about allocating things on the fly (lookout for strings!) but the biggest help is adding -Xms150m -Xmx150m to your VM arguments for your debug configuration. Couldn't figure out how to put this in source control so i'll leave this task open for now.
Found how to put the heap settings in a "common" run/debug config. Will do this tonight (hopefully). Instructions are here http://stackoverflow.com/questions/8625060/store-run-configuration-with-project-in-eclipse
Added a default launch. Can be found at top level. Just right click and debug/run as and it will add it to your run/debug configurations list..
After running for a couple minutes, the game drastically slows down.