jayendra bhatt
jayendra bhatt

Reputation: 1385

How to see memory utilisation of user java classes?

I want to analyse the memory consumption on the basis of different class files, other than the java provided classes (String,etc). I tried JProfiler, jmap and jhat - all provide the information about java classes, but nothing about the custom classes.

Is there any way to see the memory utilisation of the classes which I have written in the web application?

Upvotes: 3

Views: 53

Answers (2)

Ingo Kegel
Ingo Kegel

Reputation: 48025

The heap walker in JProfiler shows you this information:

enter image description here

after you click the "calculate estimated retained sizes" link above the table. The result is shown in the "Retained Size" column.

Upvotes: 2

Anudeep Gade
Anudeep Gade

Reputation: 1395

Yourkit has excellent memory telemetry where you can analyze class level memory. https://www.yourkit.com/docs/java/help/memory_telemetry.jsp

JVisualVM has also memory snapshot for class level but not as good as Yourkit. https://visualvm.java.net/snapshots.html

Upvotes: 0

Related Questions