gerhardub
asked on
Java Error under Linux: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space...
I've got a developer who is having a problem with Java running on RedHat EL 4 WS with the Sun JDK installed.
When she attempts to run the code, she gets this error:
Exception in thread "main" java.lang.OutOfMemoryError : Java heap space
What are the likely causes of this?
Thanks.
When she attempts to run the code, she gets this error:
Exception in thread "main" java.lang.OutOfMemoryError
What are the likely causes of this?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your program needs more memory than default (typically 1/8 of RAM)
e.g.
java -jar myJar.jar -Xmx1024M
you allocate here maximum 1 Go RAM
the number has to be a multiple of 1024
java -jar myJar.jar -Xmx1024M
you allocate here maximum 1 Go RAM
the number has to be a multiple of 1024
> the number has to be a multiple of 1024
Not necessarily. I am allocate a max memory of 222m as well by -Xmx222m
Not necessarily. I am allocate a max memory of 222m as well by -Xmx222m
Ok I see,
I had this information here : http://edocs.bea.com/wls/docs61/perform/JVMTuning.html
Anyway on this site, Chapter "Java Heap Size Options",
you have the other options available.
I had this information here : http://edocs.bea.com/wls/docs61/perform/JVMTuning.html
Anyway on this site, Chapter "Java Heap Size Options",
you have the other options available.
>>What are the likely causes of this?
How and when does it happen?
It's not necessarily the case, but it could be the sign of something wrong, such as runaway loops or recursion
How and when does it happen?
It's not necessarily the case, but it could be the sign of something wrong, such as runaway loops or recursion
ASKER
Ok folks, so she bumped the memory up to -Xmx8128M (8GB - 1/2 the RAM in the workstation), and the memory error went away.
BUT: She says the code just stops running in the middle, and that there is nothing in the log file. She can continue the processing where is stops, but it's sorta annoying.
Thoughts?
BUT: She says the code just stops running in the middle, and that there is nothing in the log file. She can continue the processing where is stops, but it's sorta annoying.
Thoughts?
Did she wrote the code ?
8 Go is a lot of memory ! maybe like CEHJ said it's a part of code not written properly which stops the process and making it consuming a lot of ressources.
Otherwise I have no idea without further details
8 Go is a lot of memory ! maybe like CEHJ said it's a part of code not written properly which stops the process and making it consuming a lot of ressources.
Otherwise I have no idea without further details
ASKER
The machine is a 16GB - 4 Processor workstation...
Where would I get the further details? Are there logs and so on that I might be able to provide you guys?
Where would I get the further details? Are there logs and so on that I might be able to provide you guys?
>>
BUT: She says the code just stops running in the middle, and that there is nothing in the log file. She can continue the processing where is stops, but it's sorta annoying.
>>
Difficult to know without more detail
BUT: She says the code just stops running in the middle, and that there is nothing in the log file. She can continue the processing where is stops, but it's sorta annoying.
>>
Difficult to know without more detail
ASKER
What details should I provide you?
What the processing is, when and where it stops, etc
Who wrote the code ?
ASKER
The person who's having the error.