Thursday, October 28, 2010

Setting WebSphere JVM Heap size without the web console

It seems that when you update the JVM Heap size settings for WebSphere through the web console via:

Servers > Application Servers > WebSphere_Portal > Server Infrastructure > Java and Process Management > Process Definition > Java Virtual Machine > Maximum/Minimum Heap Size

There is no warning at all about setting the minimum value and NOT setting the maximum value.  The maximum value by default is 256mb, so if by any chance you set the minimum to 512mb and you go get  a coffee while restarting the server, you will get the following error message in the native_stderr.log file:


“Could not create the Java virtual machine.
JVMJ9GC019E -Xms too large for -xmx “

The message is quite clear, but it doesn’t say where to change this setting and by now you will notice that your server won’t start and you have no access to the web console in order to change the settings.

So how to solve this? find the server.xml config file, that could be located in path similar to this one:

“C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\mycomputernameNode01Cell\nodes\mycomputernameNode01\servers\server1″

Please make a BACKUP before proceeding.

Then look for the “jvmEntries” xml element that could look like this:

initialHeapSize=”512″ runHProf=”false” debugMode=”false” debugArgs=”-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777″ disableJIT=”false”>


Now you can either:
  • Remove the “initialHeapSize” attribute
  • Modify the value to something equal or below 256mb (the default)
  • Add the “maximumHeapSize” and set it to equal or more than the initial, in this case 512mb
Save the file and your server should be ready to go.