En l'instant précis du 11/01/08 09:34, Morten Matras s'exprimait en ces termes:
Case:

I've deployed an application on a Tomcat 6.0 (current release). The
application is a Hibernate / Stripes application.


Almost no memory is allocated due to the deployed application.


Setting:


-Xmx64m -XX:MaxPermSize=128m
According to memory below, those settings are not take into account, or you wouldn't go over about 70M total space (java heap space of 64M max + jvm code of a few megs). Note that the PermSize is taken from the heap, so it should be lower than max heap size.

Tomcat without application uses: 27,5M (real memory) and 349M (virtual
memory)
Tomcat with application uses: 133M (real memory) and 367M (Virtual memory)


Now if I stop this application (using the manager) the memory profile
becomes:


Tomcat with stopped application: 128M (real memory) and 679M (virtual
memory)


So stopping the application increases the virtual memory usage from 367 to
679 m and stays there!
The increase is probably due to specific code your application executes when it is stopped. It seems to do memory intesive things there :) You have to be aware a JVM memory never decrease in terms of system memory size. It can only grow up to the -Xmx size. (See sun's jvm docs for details). To get an idea of what memory size is really available for your jvm, you must check the values inside the jvm (use the system class, or a easy to use tool like lambda probe).

If, even after a GC, memory is not release inside the java heap, then go check for memory leaks in your webapp.


Undeploying a stopped application doesn't change the numbers.


Why does stopping (or undeploying) a webapplication cause a dramatic
increase in memory usage?


My guesses:
 - Some ressources are not freed? (database connections)
 - Some hibernate related stuff are trapped in a circular relation circle?
 - Tomcat punishes me for stopping something it really liked :-)





--
http://www.devlog.be (a belgian developer's logs)



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to