Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] java.lang.OutOfMemoryError: Java heap space

Started by Jakarta Aug 24, 2006 at 1:45 PM 5 replies 4.1k views
Original Post
Jakarta
Jakarta
I keep on getting this OutOfMemoryError. I am using Eclipse 3.1.2 and have tried adding -vmargs -Xmx512M to the command line for the eclipse shortcut but it doesn't seem to change anything.At roughly 70mb it still maxes out and comes up with the above error. if anyone can help it will be greatly apreciated.
Paclaw
Paclaw
Basically you need to find what might causing your leak. A good place to starts are collection.

Also I've you tried to profile your application to see at what point your memory goes up?

Paclaw
Jakarta
Jakarta
Quote:
Original post by Paclaw
Basically you need to find what might causing your leak. A good place to starts are collection.

Also I've you tried to profile your application to see at what point your memory goes up?


My application requires alot of memory in the begining it is expected for it to need roughly 150 - 200mb. I just need to set the JVM to handle that.
Paclaw
Paclaw
ok I guess you should put the argument in the run property of your app instead...


Menu Run -> Run...
then select your app.
select the (x)= Arguments tab, its the second one
in VM arguments put your arg there.
Paclaw
Jakarta
Jakarta
Quote:
Original post by Paclaw
ok I guess you should put the argument in the run property of your app instead...


Menu Run -> Run...
then select your app.
select the (x)= Arguments tab, its the second one
in VM arguments put your arg there.


I already tried it and it gave the same result.
However, now I tried it again and got a new error message.

Exception java.lang.OutOfMemoryError: requested 24 bytes for promotion. Out of swap space?

Jakarta
Jakarta
K, I feel really stupid. Problem solved!

I did need a bigger heap size, but no where near as big as I thought. in fact my program was stuck in an infinite loop making more and more objects...fun fun fun.

Thanks alot for your help
Paclaw
Paclaw
Yeah but rest assured you're not alone to have this kind of bugs!



Paclaw

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.