2

My boss wants me to profile our product application to see if we can get some improvement with regard to memory usage. When I profile the memory, I get this:

memory performance results

What's the meaning of the last column ("Generations")? How can I analysis the application using this information?

dfarrell07
  • 2,872
  • 2
  • 21
  • 26
Bort
  • 97
  • 1
  • 13
  • Well, what I would do is hunt for [*performance problems*](http://stackoverflow.com/a/317160/23771) and clean them out. Sooner or later, memory allocation will be the biggest performance problem, and then you can clean that out too. In other words, approach it through the back door. If you think you have no room for speedup, I guarantee anything you can do to use less memory allocation will give you a substantial speedup. – Mike Dunlavey Aug 13 '14 at 21:03

2 Answers2

3

Concerning the "generations" column:

VisualVM comes with your Sun JDK6 for free, originates from Netbeans, look for jvisualvm in JAVA_HOME/bin. It incorporates a memory profiler that uses a metric called “surviving generations” (or short “generations”). So what is a surviving generation? Surviving generations: The number of different ages for all objects allocated on the JVM heap since the profiling session started. Age of object: The age of the object is the number of garbage collections the object has survived.

Extracted from http://www.munzandmore.com/2011/ora/memleak

About how to analyze the data, it's a broad subject. I suggest you to take a look at this:

http://my.safaribooksonline.com/book/programming/java/9780137001040

Andres
  • 10,561
  • 4
  • 45
  • 63
  • I'm sorry that I don't have a swift response . but for the second link is a book and not free , can you give me some information for free? and for the line of "generations" can I understand it like this :for one object if the number of generation is always raise and never decrease that means the object never collected by GC ? – Bort Feb 25 '14 at 01:53
  • Your understanding of generations is correct. Abut a free resurce on GC tuning, read the following, but try to find the book on the previous link if you can, also. http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html – Andres Feb 25 '14 at 10:11
  • thank you very much , and I had found the book you mentioned .it's very useful. – Bort Feb 26 '14 at 01:47
0

Surviving generations are explained in this blog post.

Tomas Hurka
  • 6,723
  • 29
  • 38