Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat - their classes from previous runs are still loaded in memory

 
amir taghvayi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

when stop my project , tomcat say :

The following web applications were stopped (reloaded, undeployed), but their classes from previous runs are still
loaded in memory, thus causing a memory leak (use a profiler to confirm) .

Where we find that Which classes are left in memory ?

please help me .
 
ali farozi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi amir

You can run jmap -histo which will show you loaded classes.

Another way is to enable classloading debug information and do some scripting to detect what is left loaded.
 
amir taghvayi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ali

jmap help is :jmap -histo <pid> .

what is <pid> ? what is jmap command line for web-app in tomcat ?

 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please keep an eye on this thread.
 
ahsan hemati
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Do the following steps:
1- get pid with jps command for example -->  pid: 2512 org.apache.catalina.startup.Bootstrap start
2- run jmap -histo 2512

show the classes remain in memory . and you can use of jconsole for tracing your project .
 
amir taghvayi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you , i get list of classes are still loaded in memory .

Why my class remain in memory ?What is the problem of class ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic