Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to monitor the memory usage of my java program. As of now I am using 'Top'. Top is a command line tool that shows you the memory usage of your program. The out put example will is similiar as the following:

$# top -p <pid>

Output:

PID: <PID>
User: <user>
VIRT: 513M 
%MEM: 25.1

I am trying to find a better memory monitoring tool that can show me what are the java objects that resides in the memory, their size, etc.

share|improve this question

closed as off-topic by Olli, Tog, random Feb 19 '14 at 2:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – Olli, Tog, random
If this question can be reworded to fit the rules in the help center, please edit the question.

You can use VisualVM to monitor memory usage in Java processes. As well as monitoring the overall heap it also includes a memory profiler so you can see what objects are using the most memory.

It is also included in the latest JDK as jvisualvm.

share|improve this answer

Maybe jvmtop is worth a look. It's a command-line tool which provides a live-view at several metrics.

Example output of the VM overview mode:

 JvmTop 0.3 alpha (expect bugs)  amd64  8 cpus, Linux 2.6.32-27, load avg 0.12
 http://code.google.com/p/jvmtop

  PID MAIN-CLASS      HPCUR HPMAX NHCUR NHMAX    CPU     GC    VM USERNAME   #T DL
 3370 rapperSimpleApp  165m  455m  109m  176m  0.12%  0.00% S6U37 web        21
11272 ver.resin.Resin [ERROR: Could not attach to VM]
27338 WatchdogManager   11m   28m   23m  130m  0.00%  0.00% S6U37 web        31
19187 m.jvmtop.JvmTop   20m 3544m   13m  130m  0.93%  0.47% S6U37 web        20
16733 artup.Bootstrap  159m  455m  166m  304m  0.12%  0.00% S6U37 web        46
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.