• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Memory usage by Java program in LINUX machine.

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Java program that I run in LINUX machine:

/usr/lib/jvm/java/bin/java -classpath .:..... -mx2m MyJavaProgram

I want to analyze the memory usage used by this program

This article (http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html ) recommends "pmap" to get more accurate picture [please see code snippet for result]. It mentions that I need to look at the "writeable/private" at the bottom of the result of running pmap command. I'm really confused why it is using 225,024K. Why is this?
Originally, I thought capping the heap size would help, but I don't understand why that much memory is being used.

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few years back I tried with YourKit profiler it has neat GUI to present data.
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Venkat,

Thanks for your reply. I actually already use VisualVM from Java to monitor this.

Another example, I run another Java program with -mx2m option but the writeable/ private almost 140M (based on the link that I sent to you I need to look at the writeable/ private)...

So I'm confused ... it's Java actually use more memory thatn what's in heap and stack?

Should I transfer this question to Linux forum probably?
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even the smallest program like this:




has huge "writeable/private" number --> more than 100MB.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic