Reputation: 12710
Using: -Xms1000M -Xmx4000M -mx1000m I still get a java.lang.OutOfMemoryError: Java heap space
If I try to increase any of these numbers, I get the following JVM error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
How can I solve this OutOfMemoryError problem? (even if I need to cache memory on disk)
Upvotes: 1
Views: 1693
Reputation: 210
How much memory does your system have? Are you running windows? You can't create much more than 1G heap with a 32bit windows JVM. If your Xms setting is greater than this limit the JVM will fail to initialize.
JPEG images are compressed. A 100M JPEG is pretty large and will be a lot larger once decompressed by the image io lib. OOM with 1G heap is quite conceivable.
Barry
Upvotes: 5