12

I am not able to open the Administrative console of websphere application server v8.5. The logs report Java Heap Space and Out of Memory errors. I have searched online and the suggestions are to increase the JVM heap size. But how should I accomplish that now, when even the admin console is not working for me ?

Is there a method to free up the heap space somehow ?

n.nasa
  • 551
  • 2
  • 5
  • 21

3 Answers3

23

In this situation you must bypass the administration console. If you want to do that just edit the configuration file for the server, i.e. edit the server.xml for that particular server, either the application server process or the deployment manager process depending on what process suffers from the memory problem.

edit the following attributes:

jvmEntries debugArgs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777" debugMode="false" disableJIT="false" genericJvmArguments="-Xquickstart" runHProf="false" verboseModeClass="false" **initialHeapSize**="512" **maximumHeapSize**="1024" verboseModeGarbageCollection="false" verboseModeJNI="false" xmi:id="JavaVirtualMachine_1183121908656"

The server.xml can be found here: /*IBM_ROOT_DIR*/WebSphere/WAS85/AppServer/profiles/*MyProfile*/config/cells/*MyCell*/nodes/*MyNode*/servers/*MyServer*/server.xml

After the update of the server.xml just restart the server process to utilize the new memory settings.

slm
  • 15,396
  • 12
  • 109
  • 124
Robert Höglund
  • 954
  • 9
  • 12
  • 2
    I'd only go this route (hacking the XML) if restarting the JVM does not get you back into the Admin console. From there memory settings can be adjusted via the GUI. XML hacking should be a last resort. :-) – Nizzo Aug 22 '13 at 12:41
  • 1
    If you never customized these settings before then by default they will not show up in _server.xml_. You can add them in the `jvmEntries` tag as shown above. – javaPlease42 Jan 04 '15 at 23:50
  • 1
    even after updating server.xml file still I'm not able to start the server. Is there any alternative? – Vamshi Feb 10 '15 at 17:34
3

Search for a file named server.xml in your WebSphere installation. Generally, the location of this file is as follows:

<profilehome>/config/cells/<cellname>/nodes/<nodename>/servers/<servername>/server.xml

Select the server.xml specific to your server and edit it to add/modify/delete the attributes initialHeapSize and maximumHeapSize of the element <jvmEntries>. The value of these attributes is the heap size in MB.

For example:

 <jvmEntries ... initialHeapSize="2048" maximumHeapSize="3072" ...>
 ...
 </jvmEntries>

Then restart the server.

KeatsPeeks
  • 19,126
  • 5
  • 52
  • 83
Joginder Malik
  • 455
  • 5
  • 12
1

You need to restart your Websphere profile to free up memory:

Windows:

cd WAS_home\profiles\profile_name\bin
stopServer.bat server_name
startServer.bat server_name 

Unix:

cd WAS_home/profiles/profile_name/bin
./stopServer.sh server_name 
./startServer.sh server_name

After that you can change appropriate settings in WAS administration console. Or you can edit profile configuration file server.xml before restarting. And of course you need to establish the reason of the OutOfMemeory error. Most likely it's a memory leak in some application on this server.

Ivan Nikolaev
  • 420
  • 2
  • 6