Thursday, November 1, 2012

Increase HeapSize on server.xml for OutOfMemory Exception

If you are running SOLR or any other high memory process, there is a chance, you have seen the OutOfMemory exception. You can increase the heap-size using WAS or directly in the file. Recommended approach would be directly in the file. 

From WAS console:
  1. In the administrative console, click Servers > Server Types > WebSphere application servers, and then click on an application server name.
  2. In the Server Infrastructure section, click Java and process management > Process definition .
Directly updating the file, as this is the same file that gets updated while changing WAS console: On toolkit, this would be the path
C:\WCDE_ENT70\wasprofile\config\cells\localhost\nodes\localhost\servers\server1\server.xml
Search for initialHeapSize and maximumHeapSize and change 
initialHeapSize=512
maximumHeapSize=1536
or you have only 1024 try
initialHeapSize=1024
maximumHeapSize=1024
If you give incorrect values here, it could result in your server not starting so please be cognizant about that.

2 comments:

  1. Thanks for the solution. It worked.

    ReplyDelete
  2. These strings aren't present in my server.xml file - where should I add them if they aren't present?

    ReplyDelete