21

From the Debug view, when looking at the Variables tab, is there a way to easily see how much of the heap a given variable is consuming? (Something akin to Java's Heap Analysis Tool)

2 Answers 2

6

I think this will help:

Memory Analyzer (MAT)

The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.

Use the Memory Analyzer to analyze productive heap dumps with hundreds of millions of objects, quickly calculate the retained sizes of objects, see who is preventing the Garbage Collector from collecting objects, run a report to automatically extract leak suspects.

Sign up to request clarification or add additional context in comments.

2 Comments

i was seeking a tool that would let me see total memory usage per object during a live debugging session.
Exactly this is a poor answer. This tool requires a dump of the heap while the JVM is running and then analyzes the contents externally. An actual solution would add mouse-over memory sizes to variables from the variables page inside the live eclipse debugger.
1

A half-measure would be to watch for changes in the total RunTime's used ram with something like:

Runtime rt = Runtime.getRuntime(); long currInUse = rt.totalMemory() - rt.freeMemory();

1 Comment

This does not answer the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.