Search code examples
javaperformancemonitoringjmx

How to monitor application information in java?


I'd like to see things like the objects on the heap created by my simple class. However, when I use netbeans profiler to look at my running program, I see thousands of classes, presumably all the good things that java is doing behind the scenes.

Is there a way in netbeans profiler to drill down to the details of only my thread, and objects that are reachable from my thread? Are there other tools that would be good for that?

I'd like, for example, to be able to see if I'm creating any large, unnecessary objects, how much memory my objects are using up, things like that.

I'm particularly interested in mac/linux.


Solution

  • There's a textbox at the bottom where you can filter the classes being inspected. There you should write the complete name of your class(es) to inspect.

    enter image description here

    (Sorry, couldn't find a more exact image, but the same textbox appears in the Memory part)


    Here's another image where the textbox appears and the text on it is clear: Class Name Filter. Just write complete.nameof.YourClass and it will show the necessary info.

    enter image description here
    (source: java.net)