Hi i have a web application deployed on 2 different machine.
I've run the same setup of jdk and tomcat on both the machines, but when i look at the heap usage on both the machine, on one machine heap memory usage and GC activity runs fine, but on other machine, heap memory usage n GC Activity i found it inefficient. and ultimately my jvm goes down.
Are these two machines clustered or load balanced? Make sure that the load is balanced properly. Did you compare the JVM arguments in both boxes? Did you check that your JVM has started with the actual supplied minimum memory (if you have any error in the script or config it may have been ignored)?
It's not a bad idea to do a memory analysis. One situation where this kind of situation may occur is is one of the machines is getting hit by unusual circumstances.
I once inherited a program from someone who shall remain nameless. He assumed that everything was going to work perfectly all the time and never coded finally-clauses to catch and clean up after database operations. Over time, of course, this can end up in leaking out not only memory, but network sockets. Eventually, of course, the app would crash.
His motto was "we don't have time to do it right, but we always have time to reboot." Sadly, he's not unique.
An IDE is no substitute for an Intelligent Developer.
Joined: Dec 12, 2006
my code is clean and every database operataion is enclised with try catch and finally block.
but whay the same code/application is running perfactly on my laptop. but not on actual server.
Is there any dependecy for GC, like OS,Processor or something... can we set the GC policy ?