Total Pageviews

Thursday, August 2, 2012

How to Increase Java memory option and GC (Garbage Collector ) in POS Client or any batch file


Below command will set Java Memory option in any batch file.
set JAVA_MEM_OPTIONS=-Xms256m -Xmx512m

Below command will add garbage setting in any batch file also you can generate GC log.
set GC_OPTIONS=-XX:NewSize=85m -XX:MaxNewSize=85m -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+DisableExplicitGC -XX:+UseTLAB -Xloggc:%LOGHOME%/logs/VerboseGC.log

Note -%LOGHOME% is a variable you need to set its value somewhere in the batch file.

 Add more JAVA_OPTIONS lines to inlude more options.
set JAVA_OPTIONS=%JAVA_MEM_OPTIONS% %JAVA_OPTIONS% %GC_OPTIONS%