How to increase WebSphere JVM memory

Problem

When a J2EE web application is deployed into the WebSphere Application Server 7 (WAS), the WAS started to load very slow and keep hanging for whatever actions selected, end with a “java.lang.OutOfMemoryError” error message in the WebSphere’s log file.

Solution

The default WebSphere’s Java Virtual Machine memory is not enough; you should adjust more memory to your WebSphere Application Server. See following guide to increase WebSphere’s JVM memory.

1. In WebSphere web console, select Servers -> Server Types -> WebSphere application servers -> Server Infrastructure -> Java and Process Management -> Process definition.

WAS-adjust-memory-1

2. In Additional Properties section, select Java Virtual Machine

WAS-adjust-memory-2

3. In General Properties section, put 256 for “Initial heap size” and 1024 for “Maximum heap size”.

WAS-adjust-memory-3

Done, restart WebSphere.

Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • elissaf

    Hoping this helps (I’ve needed to restart WAS every 3 or 4 deployments). Can you speculate about the size of the heap as compared to one’s amount of RAM? I’m wondering if 2048Mb would be even better…

    Thanks!

    • Nilakanth

      Hi All,

      I increased Heap memory but after changing the Heap memory ,server is not getting started.
      My friend experience same problem but we don’t have ideas of solution.
      Please advise the solution.

      WE are using the cluster of two servers :
      IBM WebSphere Application Server – ND, 6.0.2.41

  • Pravin

    Hi,

    Thanks for this post, it solved my problem.

  • http://inology.nl Tjerk

    Hey!

    Are you able to deploy a Wicket 7 application on WS7?
    If so, do you use the servlet or the filter approach?

    Thank in advance,
    Tjerk

  • Bruce Alvarez

    Thank you VERY much for this tip. I’ve been using WAS for over 10 years and just now ran into an out of memory error and had no idea how to fix it.

    I would suggest a couple of small changes to the instructions.
    1) It wasn’t clear at first that “server infrastructure” in step 1 was the server I wanted to modify as opposed to another drill down function
    2) You only need to restart the specific WAS server you modified.

    Again, a very big thank you

    Bruce

  • http://www.jdbctutorial.net JavaDude

    Hi Yong.

    I am unable to access your site from behind my company’s proxy? its taking to much time to load and then timeout happens. i really miss your site badly :(

    Any solution.