0

I have been thinking about how to manage RAM between different 3 java webapps. I have blurred concepts in mind. Deploy all the web apps in the same tomcat7 instance or have 3 different instances of tomcat 7 in which I will deply a web app each.

But the big questions is how to efficiently share 10GB of the box (12GB RAM) among them? let's say I have 3 GB for mysql, so app A takes 4GB, app B 2GB and C 1GB.

what are the known and best practice to achieve this?

black sensei
  • 609
  • 3
  • 8
  • 25

1 Answers1

2

If you haven't already, you should profile you applications through load testing, code profiling, gc logging, etc to see how the actual memory footprint, and address any memory leaks ahead of time.

Having said that, I would go for three separate instances of Tomcat, each running its own app. This way you can set memory allocations (Xms, Xmx, etc) per Tomcat process/instance. I don't think you can set those per app.

Another advantage of running separate instances of Tomcat for each app would be the ability to restart each instance of Tomcat separately (if you had to), without effecting the availability of the other apps.

KM.
  • 1,746
  • 2
  • 18
  • 31