Computer Science Canada OutOfMemoryError |
Author: | SsJBebiGoku [ Fri Mar 04, 2005 8:54 pm ] |
Post subject: | OutOfMemoryError |
Hi. I have a funky OutOfMemoryError going on with my chat-like program (i'ts not done). Before i had everything going through the console itself just for testing purposes and everything worked fine..now it seems after you return a message, there is an OutOfMemoryError. Attached are the required files. Thanks in advance |
Author: | Hikaru79 [ Fri Mar 04, 2005 11:40 pm ] |
Post subject: | |
Just without looking through the code, the only reason that would generally happen is if you have a function the infinitely recurses. Just check to see if you have a function calling itself without ever stopping. That's the case in OutOfMemory errors 90% of the time. |
Author: | SsJBebiGoku [ Sun Mar 06, 2005 5:11 pm ] |
Post subject: | |
I've checked it many times over before posting it on the site, and there is 1 or 2 while (true) loops that i hv commented out for debugging purposes to see if they were the reason, and they were not. |
Author: | rizzix [ Sun Mar 06, 2005 5:21 pm ] |
Post subject: | |
It usually is a recursive function or class that has no limit to its recursion that results in an OutOfMemoryError. Other factors include infinite loops that create new objects AND hold references to the newly created objects. |
: |