Posted By:
a_w
Posted On:
Tuesday, April 7, 2009 04:11 PM
I recently had to reinstall a new implementation of Java, which works fine except one of my programs suddenly began generating an "OutOfMemoryError: Java heap space" every time I run it (which it hadn't been doing right before the reinstall), and it does this even if I reduce the memory needs down to a fraction of what they had been. More strangely, larger programs work fine - e.g., I tested Runescape, which is an enormous, graphics-heavy game which takes forever to load even with broadband, but even that one runs fine - and at maximum detail. When I print out the memory stats when my own program runs, here's what I get: Total memory: 5177344 Initial free memory: 2675368 Free memory after garbage collect
More>>
I recently had to reinstall a new implementation of Java, which works fine except one of my programs suddenly began generating an "OutOfMemoryError: Java heap space" every time I run it (which it hadn't been doing right before the reinstall), and it does this even if I reduce the memory needs down to a fraction of what they had been. More strangely, larger programs work fine - e.g., I tested Runescape, which is an enormous, graphics-heavy game which takes forever to load even with broadband, but even that one runs fine - and at maximum detail.
When I print out the memory stats when my own program runs, here's what I get:
Total memory: 5177344
Initial free memory: 2675368
Free memory after garbage collection: 3239888
These numbers seem incredibly small given that my machine has 2 gigabytes of onboard memory.
My question is: how do I allow more memory for my program? I assume Runescape must be allocating more memory for itself than what my program is allowed, but I haven't been able to find any means of doing that in the online material I've looked at.
Please bear with me if this is a naive question.
Any help is greatly appreciated.
<<Less