Memory Leak

Any guesses on where the new memory leak is at?DennisBergkamp wrote:I still haven't figured out how to fix the memory leak problem completely though.
I know Forge had a previous memory leak because Phase.nextPhase() was used to advance everything and the stack which keeps track of all the method calls would overflow because nextPhase() was continually used.
The problem is that the stack trace never stops, it just keeps getting larger. If AllZone.Phase was created at the beginning of every game
- Code: Select all
AllZone.Phase = new Phase();
(I guess I pushed the observer pattern to the extreme and sort of broke it. Using global static variables can be tricky because you can easily shoot yourself in the foot.)
You can use Thread.dumpStack() to view the current stack.
Stack errors are very hard to understand. I passed the Java Certified Programmer test but it didn't cover the stack at all.
(In Magic and Java the stack is hard to understand.
