2

I have a java application that its memory starting to jump and fall after few days.
Is there a tool that can show me the variables/members sizes during run/debug in real time?

Debugging it with eclipce is impossible.

4 Answers 4

4

Check out jhat and jmap.

In the longer run, consider adding a monitor to your app (with JMX, or write your own). It may help you in many situations in future.

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

1 Comment

This y I have asked, the jmx point to me that there is a memory problem, now i need a tool that will detail it.
3

Install this: http://visualvm.java.net/eclipse-launcher.html and then launch using Eclipse. This does not use the debugger, but launches the VisualVM application which lets you monitor the app. You'll need to go into the Run Configurations.. settings to set this up, and select VisualVM launcher at the bottom (Select Other... -> VisualVM launcher). You'll need to go into Preferences to set up the location of VisualVM too.

(On later Eclipse versions, drop it into the drops folder, unpacked).

1 Comment

No probs :) Also, JRockIt Mission Control on the JRockIt VM is even better, but similar in nature.
2

If you're using >JDK6 and can get access to the machine then jvisualvm.exe may work, part of the JDK (in the bin dir)

Comments

1

yourkit (http://www.yourkit.com/) can do that, but expect a HUGE degradation on the performance of the app, as it has to track the size of each object.

I think it's better if you run yourkit with a few less invasive options, and then you can take snapshots of the memory usage.

I forgot to add, that with yourkit you can run the application without almost any instrumentation (which will slightly degrade the performance of the app) and when the problems start ocurring, you can enable the more heavy weight profiling while the app is running.

1 Comment

I don't a large performance hit using YourKit. It can be up to 30%, but that often less than not having your application tuned. (If you use CPU tracing instead of sampling its very slow, but the OP wants memory allocation tracing I suspect)

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.