Skip to content

Set the heap size of java with Garbage collection enabled

I am running JVM in a ubuntu ec2 instance which runs only solr and nothing else. Now I wanna configure the Heap size of the JVM which is running. The problem is I am not using Sun Jdk I am using the following versions and settings

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

How do I reset the heap size to my requirements.Also I want to enable the garbage collection. How can I do it. I am not running tomcat6.

Kindly Help me



This article has some useful information on tuning the heap size for a server application. As for “enabling” garbage collection, it’s always turned on on a regular VM; the only ones that don’t have it are for tiny embedded applications like JavaCard.

9 People found this is helpful