• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Heap usage increases without web-app usage

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have jConsole monitoring our Tomcat v5 web-application using Suns 1.5_08 JDK.

Without any users on our web-app, what I find puzzling is that jConsole shows the heap usage going up, to then be gc'ed only to go up again - with the overall effect of the graph showing a gradual higher heap consumption. If I click the gc button in jConsole then the heap usage drops significantly - whereby the trend starts over again.

Any ideas?


thanks,

Jac
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even without active web-users, you can have other threads in the JVM creating temporary objects. As long as you are coming down to a reasonable usage after GC, you should not worry.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dont look at JVM memory usage unless you have reason to. Typically its the job of GC thread to watch for heap usage and execute it at regular intervals to remove unreferenced objects. So this typically results in a JVM heap usage pattern as you have mentioned.

If you are facing issues with memory like getting OOM error, then you can try tweaking the JVM heap settings if that solve the problem. In case nothing works, you may need to look at the memory usage pattern using some memory profiler tools to determine if your application is leaking memory.

As long as you practice good design and coding practices in your application development, performance tuning/monitoring should not be attempted pro-actively unless the situation warrants it. In most cases it results in unwanted efforts spend on tweaking code, without any results, and at times spoiling readability and OO-ness of the code.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It could even be the communication with the JConsole which is creating those objects, I suppose.
 
Virag Saksena
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you try disabling jConsole and running it with Auptyma JAM. Enable monitoring and see if the heap usage is still going up and down. Since JAM does not create any extra objects in the JVM, you'll be able to figure out if jconsole was creating the objects.
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic