Inspections

Questions about YourKit Java Profiler
Post Reply
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Inspections

Post by pebl »

Hi,
How do I create more inspections than those already given?
I can create more probes, but I dont think they do what I want.

Given a snapshot
1)
I want to be shown the java.lang.Strings where
len < buf.length/2
(e.i. wasting mem caused by substringing)

2)
I want to be shown objects having an int field variable in a specific range.
e.g. All objects that have a field "httpstatus" with a int value between 500 - 600.
Other fieldnames and ranges are also wanted, but less generic like "status" in range 40000-50000.
I know the snapshot should contain few or none of those objets.

Peter
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Hi Peter
How do I create more inspections than those already given?
There is no API for adding new inspections by users. Please suggest them in the forum, and we'll consider implementing them.
I can create more probes, but I dont think they do what I want.
I guess that in your case (memory issues) they won't help.
Given a snapshot
1)
I want to be shown the java.lang.Strings where
len < buf.length/2
(e.i. wasting mem caused by substringing)
Which Java version do you use?

There is no char array sharing anymore since Java 7 update 6. Each string has its own copy.
2)
I want to be shown objects having an int field variable in a specific range.
e.g. All objects that have a field "httpstatus" with a int value between 500 - 600.
Other fieldnames and ranges are also wanted, but less generic like "status" in range 40000-50000.
I know the snapshot should contain few or none of those objets.
Unfortunately, such requests are impossible now. Perhaps we'll add an object query language or similar feature in the future.

Best regards,
Anton
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

How do I create more inspections than those already given?
There is no API for adding new inspections by users. Please suggest them in the forum, and we'll consider implementing them.
Which forum? This?
I want to be shown the java.lang.Strings where len < buf.length/2
(e.i. wasting mem caused by substringing)
Which Java version do you use? There is no char array sharing anymore since Java 7 update 6. Each string has its own copy.
1.5 and 1.6 in production and it will not change for a long time.
I want to be shown objects having an int field variable in a specific range.
e.g. All objects that have a field "httpstatus" with a int value between 500 - 600.
Unfortunately, such requests are impossible now. Perhaps we'll add an object query language or similar feature in the future.
Is it possible to see all objects extending a given object (fx. extending object HttpHeaderReply)?
And then sort the objects using specific field?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Which forum? This?
Yes.
1.5 and 1.6 in production and it will not change for a long time.
We've dropped Java 5 support years ago. The latest profiler version which supported Java 5 was YourKit Java Profiler 8.0.x:
http://www.yourkit.com/download/older.html

Java 6 will reach its End of Life soon. We'll keep supporting it in the foreseeable future, but I'm afraid we can't spend time adding new features for Java 6 only.
Is it possible to see all objects extending a given object (fx. extending object HttpHeaderReply)?
Yes, by using Ctrl+N.
And then sort the objects using specific field?
There is no sort-by-field-value functionality in the existing UI. We can consider adding it.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

Anton Katilin wrote:
Which forum? This?
Yes.
Ok.
Anton Katilin wrote:We'll keep supporting it in the foreseeable future, but I'm afraid we can't spend time adding new features for Java 6 only.
Ok.
Anton Katilin wrote:
Is it possible to see all objects extending a given object (fx. extending object HttpHeaderReply)?
Yes, by using Ctrl+N.
Ok ...
Anton Katilin wrote:There is no sort-by-field-value functionality in the existing UI. We can consider adding it.
Ahh, half way there then. It would be cool if I could right click on field with a primitive type and sort by it.
I would not need the generic api then.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

Anton Katilin wrote:There is no sort-by-field-value functionality in the existing UI. We can consider adding it.
Posting to an old thread;
Do you have any plans on adding a sort-by-field?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Hi,

Unfortunately, we don't have certain plans for this feature at the moment.

Best regards,
Anton
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

Do you have any other way of achieving? (This is wish from 2013 I still have, so there may have been added features I have not noticed)

So I have a number of instances of HttpOperations. They have a httpstatus field.
There are a lot of those; 1000+. I want to find those where something went wrong
and have a httpstatus of 500-600.
I am ok if I only get one instance at a time, but not ok if I have to expand 1000+ to find one.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Would it make sense for you If we added an action to open instances with given field in given range, but without sorting which is more difficult to implement?

So you'd be able to extract HttpOperations having httpstatus within 500-600 by opening them in a new tab, but they'd be shown in the object explorer as they are shown now.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

Absolutely.
I dont need sorting, I just need to look at individual instances to check events for that instance.
However they are hard to find among 1000+ good ones.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

We've implemented this internally. The first EAP build will contain the new action. I'll notify when it is available for download.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Hi,

The EAP has started.

The new action is "Memory | Objects by Field Value... (Ctrl+Shift+F)". Please find detail in the change list: http://www.yourkit.com/eap

Best regards,
Anton
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Inspections

Post by pebl »

I have tested, and it works. I have all I asked for here now.

I have 3 suggestions;
1) In object explorer when rmb on a field, I get a menu.
The menu have a sub menu called "Open Selection".
It would be nice if this new option was included,
so selecting it would open the "Find Objects by field value",
with the current selected field name and current value fill out.

2) The popup could be a bit nicer;
You should a least separate the inputbox for fieldname and values.
So have a least 2 inputboxes, 1 for fieldname, 1 for values.
I think 3 inputboxes would be preferable. field, min, max.

3) It could be a nice touch if the value could be an object index.
So I could search for "socket #134431".
I dont know if I (anyone) ever would need that.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Inspections

Post by Anton Katilin »

Hi,

Thank you for the suggestions. We've just released EAP build 12 that implements some of them.

1. If a primitive field is selected when the action is invoked, its name will be pre-selected.

We didn't add a popup menu item, but you can use the shortcut Ctrl+Shift+F.

2. There are two input fields now: field name and thresholds. We opted not to have separate fields for min and max to allow adding more complex comparisons in the future, not only min and max.

3. These indices are in fact random, they do not reflect any real object properties. It's just the object numeration inside the snapshot. The only purpose of showing it in the UI is to help users distinct objects with same properties (duplicates). I don't think it makes sense to search by this index. If you see an object with some particular index in any view you can always open that object in a new tab by using the "Open Selected Objects (F4)" action.

Best regards,
Anton
Post Reply