• Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory leak in Tomcat  RSS feed

 
lekha phijo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am monitoring my application with a Jprofiler.
I get neat spikes.memory goes to 52 kb and drops to 17 kb.
My heap size is 512MB.
After the activity is done with the memory usage continues to be 52kb.
It does not drop.
Now if I close the browser window also it does not drop.
Why is it so.Why doesnt gc run when application is idle or closed?
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general GC will run if your heap is going to be full.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what this has to do with JDBC. I'm moving it to our peformance forum since it seems to pertain to garbage collection. (If that's not the right place, feel free to move it on.)
 
lekha phijo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
You are right This should be moved to Performance.
Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops. I forgot to move it!
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by lekha phijo:
Why doesnt gc run when application is idle or closed?


Well, that heavily depends on what JRE you are using. The only guarantee the Java specification gives, as far as I know, it that the gc is run before you get an OutOfMemoryError.

But why do you care?
 
lekha phijo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it should not matter if GC would run before an outofmemory exception.
I was wondering ,Ideally when application is idle GC must run.
Never mind I think we can close this issue
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!