tags:

views:

30

answers:

1

I am having more than 150 web applications in my tomcat web-apps directory can these be the one of the reason for increase in memory usage. i have installed tomcat as a service .

A: 

Yes, certainly. It has got to store the data somewhere. The memory is the best and fastest place to do that. Every created object instance/primitive value in Java code will be stored in memory.

If you have problems with it, then either increase the available memory for Tomcat or profile the webapp's code and fix memory leaks/inefficiencies accordingly. You can also consider storing large and more permanent data in a relational database instead and load only the relevant data on a HTTP request basis.


Update: If you're using Netbeans, you can use the builtin profiler to profile the webapp during development: http://profiler.netbeans.org. Further you can use VisualM to independently profile Tomcat. Here's a nice blog which outlines how to do that. You can stresstest webapplications using JMeter.

BalusC
but I am using only one application rest of them(149) are just the back up of the one, is these causes memory issues
Lalchand
A deployed webapp certainly costs memory, but if the webapp isn't been used, never accessed (also not by bots) and does in fact *nothing* in the background, then it shouldn't *increasingly* cost memory. If that is the case, then likely the main webapp is leaking memory. As said, run a profiler to spot the leak/inefficiency in the code.
BalusC
i need some profiler right , can you tell which profiler is the best to monitor memory leak also it should have a option of monitoring the tomcat via remote machine(i mean some other machine), i have already goggled regarding this unable to find any.
Lalchand