My thoughts as an enterprise Java developer.

Friday, September 20, 2013

Increasing the max heap size can increase the chance of an OutOfMemoryError in Java

4.5 years ago I encountered a problem where I fixed an OutOfMemoryError by decreasing the max heap size.

Basically there is a C++ heap and if the Java heap takes up too much space then the C++ heap can get an OutOfMemoryError.  This generally happens when the java heap size is too near the maximum that that O/S allows – for Windows XP that max is in the 1.2 to 1.4 GB range so if your max heap size is 1 to 1.2 GB you may experience this problem.

No comments: