Problem:
The error ‘java.lang.OutOfMemoryError: Java heap space’ is caused when the JVM (Java Virtual Machine) runs out of available memory during processing. This can be caused by:
- a large number of files on your system
- an extremely large benchmark document
- an OVAL test that returns a large number of results
- a system that doesn’t meet the minimum memory requirement of the NG Scoring tool (256MB)
The NG tool by default sets a maximum heap size of 256MB. The directions below describe how to increase this value on UNIX and Windows systems.
Solution:
For UNIX systems:
When running the tool include the heap space argument ‘-Xmx’. For example:
./ng.sh -Xmx512m
Where ‘-Xmx512m’ sets the maximum heap size to 512MB of memory. Higher values may be used where additional memory is available.
For Windows systems:
1. Edit cli.bat located in the directory the tool was installed to. This directory is ‘c:\Program Files\The Center for Internet Security\CIS NG Scoring Tool’ by default on most systems.
2. On line 33 change the text -Xmx256m to a larger value. For example:
java -Xmx512m -Djava.library.path=./lib -classpath ‘%CLASSPATH%’ org.cis.cli.Application %*
Where ‘-Xmx512m’ sets the maximum heap size to 512MB of memory. Higher values may be used where additional memory is available.
3. Repeat step 2 on gui.bat also located in the directory the tool was installed to.
Memory Problems With Mysql Connector
GOOD:
mysql.jar (221 kb, 10/7/2003)
mysql-connector-java-3.0.16-ga-bin.jar (231 kb, 11/16/2004)
mysql-connector-java-3.0.17-ga-bin.jar (241 kb, 6/22/2005)
BAD (memory leak):
mysql-connector-java-3.1.10-bin.jar (409 kb, 6/23/2005)
mysql-connector-java-3.1.14-bin.jar (449 kb, 10/18/2006)
… (other versions)
mysql-connector-java-5.1.6-bin.jar (687 KB, 3/5/2008)
