1

I have a tool developed using java . This tool runs on a linux host. I only have terminal access to this host.

The data size that this tool processes is huge and i wish to see the heap usage or the total memory being used by this tool when it is running.

Is there any way that i could do this from the terminal.

Also could you please explain how to do the same when a program is running in eclipse.

1
  • You can use jvisualvm and jmc remotely, or you can use jmap or jstat locally. BTW starting with terminal access you can create a VNC session and run eclipse via ssh -T over port 22. Commented Aug 24, 2015 at 18:26

2 Answers 2

2

Use Oracle jvisualvm to profile your app. Also you can dump heap of running app with jmap utility, also from jdk. Then jvisualvm helps you to view contest of dump

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

1 Comment

Friendly reminder : Dumping the heap might not be a good idea if the data size is huge and it could stall the app.
0

I agree with @stranger in the q's answer. However, I'd suggest you to take a look at the gc logs if configured which should give you a good idea of how the heap is being filled. Unless you want real time monitoring which you could do with jvisualvm and other j* tools that cone default with Oracle jdk - I would first read up on what they do and their cost, if in case they pause the app to enable the instrumentation needed to provide the information.

As for Eclipse, you can apply the same tools to monitor your local jvm.

Comments

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.