petepalmer
asked on
Out of memory
Hi all,
I'm having a bit of trouble with my application. It tries to load a reasonably large result set into memory. Now on my laptop which only has 512MB of RAM - this is quite easy to understand. So, this nice new computer has 4GB of RAM specifically to handle this problem..... only it doesn't. Java still kicks out with an out of memory error. I can't figure out why as the system is showing 3GB free. Is there some sort of memory limit in the jvm itself that I need to change? I'm pretty screwed if there isn't lol.
Hope someone can help.....
Cheers,
Pete
I'm having a bit of trouble with my application. It tries to load a reasonably large result set into memory. Now on my laptop which only has 512MB of RAM - this is quite easy to understand. So, this nice new computer has 4GB of RAM specifically to handle this problem..... only it doesn't. Java still kicks out with an out of memory error. I can't figure out why as the system is showing 3GB free. Is there some sort of memory limit in the jvm itself that I need to change? I'm pretty screwed if there isn't lol.
Hope someone can help.....
Cheers,
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Tuning Garbage Collection: http://64.233.183.104/search?q=cache:lZC_dOVHxUIJ:java.sun.com/docs/hotspot/gc/
ASKER
Well it runs a LOT faster now regardless....
Guess I didn't need to acquire a brand new workstation with more ram than the starship Enterprise..... oh well - my bad :)
Guess I didn't need to acquire a brand new workstation with more ram than the starship Enterprise..... oh well - my bad :)
run your application with
java -Xms3072M -Xmx3072M file.class
using -Xms and -Xmx we are setting the maximum and minumum heap size, so that you can run your application effectively by changing the heap size
java -Xms3072M -Xmx3072M file.class
using -Xms and -Xmx we are setting the maximum and minumum heap size, so that you can run your application effectively by changing the heap size
here 3072 stands for 3 GB RAM usage
>> oh well - my bad :)
:°D
Thanks
:°D
Thanks
ASKER