N/APosted on - 10/19/2011
Hi to all!
Not exceeding the limit of my hard disk, but very near it, I have increased the initial and maximal heap size to deal with this error. Do I need to add some external memory?
Will this fix the error permanently?
Please share what you think about this error, thanks.
An unexpected error occurred. Your data may be inconsistent, and subsequent errors may occur. Java.lang.OutOfMemoryError: Java heap space
Java Error: Java Heap Space
This kind of error indicates that an object creation failed because there was no available heap space for it.
Here is a solution for that:
Check for memory leaks. – Use the Jconsole memory tab in order to examine the graph of your memory usage of your application overtime.
Increase the heap size. – Use the JVM flags -Xms and -Xms to set the initial and maximal heap size. Make sure that it's not exceeded by the physical memory size, other wise you encourage paging which affects performance. Sometimes, installing additional physical memory is required.
Reconsider the design – An inadequate design can consume too much heap space and cause this OOME. For example, disc/database storage can replace some of the data structures in RAM, and memory sensitive mechanisms such as weak/soft references can be introduced.