This content has been marked as final. Show 4 replies
1> Have you tweaked your jvm?
2> What are the values given for Xms and Xmx?
3> What is the size of XX:MaxPermGen?
4> How much RAM is available on the system where you have deployed your app?
5> Are you using pre-complied JSPs for faster response?
6> Which JDK are you using?
7> Have you tried using latest version of Tomcat?
8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
I hope answering these questions would help you :)
While all the questions are valid, the symptoms described by the original poster most likely indicate a memory leak in the application, which should be checked in the first place, instead of mitigating the problem by increasing the available memory with JVM params.
BTW. I prefer to call Java memory leaks as "memory thefts" since it better describes what happens in Java applications (the code takes the memory and "illegally" keeps it, its a bit different from memory leaks commonly known in C/C++ where a pointer to allocated memory is lost).
Yes, I agree that it could be a memory theft (leak). But before that we need to understand if the required memory is allocated to keep the user objects in memory is sufficient or not. if you give 256M heap memory and the user objects required for 150 users asks more than 256M, it is bound to throw memory error,
If at all,
1> heap memory allcoating is right,
2> the process still consume more memory than expected,
then we can say it is memory theft. For that we can use a profiler to see which objects are the culprits
Sounds like there is a memory leak based on your description.
There are pretty good tools available to detect memory leak. VisualVm is one of them. Attach VisualVm to the java process and monitor the used heap usage when users logs in.
If you suspect there is constant increase in memory. Take couple of heap dump and compare them. You can use visualvm or jmap tool to force heap. Use jhat/visualvm/net beans
or memory analyzer to find out which java objects are holding memory.