Main Tutorials

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.

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
13 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Dev Easy
6 years ago

Thank you so much!

Adri
1 year ago

how you do this in command line?

Ashok Chowdary
8 years ago

please tell me some reasons for out of memory ?

sarah k
8 years ago

Thank you so much, you saved me again, you are so awesome.

Alex
9 years ago

Thank you so much, saved me much time!

Sam
9 years ago

Thanks for your help, that’s very good for me.

Picsou
9 years ago

Thanks a lot for your help, this was so helpful!

elissaf
11 years ago

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
10 years ago
Reply to  elissaf

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
11 years ago

Hi,

Thanks for this post, it solved my problem.

Tjerk
11 years ago

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
11 years ago

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

JavaDude
13 years ago

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.