javagirl
javagirl

Reputation: 1675

How to give the tomcat maximum memory physically available on the server?

How to give the tomcat maximum memory physically available on the server?

I'm going to use a lot of caching in the webapp, so I do need a maximum RA-memory available to my app. To avoid possible OutOfMemory errors, etc.

Let's assume that server has N GB of RAM, and it's 64bit. I should run it under some options?

Additional related question:

How to see the memory left, or used by tomcat on the linux server? If I run it under windows I can open the java console GUI app to see the level of used, available, free and so on by any java app... how to do the same on the linux console?

Upvotes: 0

Views: 1205

Answers (1)

belgther
belgther

Reputation: 2534

the only way I know is adding -Xmx4096M into catalina.bat/catalina.sh to the place where the executable is being run. Of course, you replace 4096 with your physical memory in MB. For 32 bit, you can't go beyond 2 GB, at least in Windows. About seeing the used memory, you can type "ps aux | grep tomcat" in command line.

Upvotes: 2

Related Questions