1

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.

2 Answers 2

2

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)

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

2 Comments

Great - thank you! If I allocate an ArrayList<String> in my class, how do I separate that out from all the other ArrayList<String> the other threads like garbage collection are allocating? Is there a way to pick out objects by variable name for example?
@user384842 you cannot know the name of variables at runtime. So, it would be impossible to know that info from a profiler.
0

I don't know much about NetBeans Profiler, but I have some other suggestions for tools that I know more about because I work with them....

If you should still be using JDK 6, you could use the Memory Leak Analyzer tool from JRockit Mission Control.

Otherwise maybe MAT, or Java Flight Recorder (Java Mission Control)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.