500 elements limit for arrays in "Object explorer"

Questions about YourKit Java Profiler
Locked
wantosz
Posts: 1
Joined: Tue Sep 04, 2007 8:29 pm

500 elements limit for arrays in "Object explorer"

Post by wantosz »

Let say I have an array of size 600. I would like to be able to inspect, for example, the last element. The "Object explorer" lists first 500 only and shows "and more..." below, but there appears no way for me to either advance to next 500 or view element at specific index. Am I missing something?

(PS. I am viewing an HPROF dump)
Anton Katilin (YourKit)
Posts: 157
Joined: Wed Aug 15, 2007 9:09 pm

Post by Anton Katilin (YourKit) »

Hello,

This number is hardcoded.

We'll add ability to advance to next 500 or similar means to browse more elements in future version.

Could you please provide more detail on why you need to manually browse content of such big array. I hope I'll be able to suggest suitable workaround and/or an alternate approach.

Best regards,
Anton
zenkar
Posts: 1
Joined: Thu Mar 20, 2008 10:06 pm

Post by zenkar »

I have same issue.

I have two lists of instances for a given class in two snapshots. The lists are about 4800 items long. They differ in ONE instance. I need to know which one it is and all I get is "and more..." at the end of the list.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

You can try "Memory | Retained Objects..." (Shift+F4) for each of the lists, and then analyze content of a new tab which will open.
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re:

Post by Yannis »

Anton Katilin (YourKit) wrote: We'll add ability to advance to next 500 or similar means to browse more elements in future version.
Hi !

Any news on this since 2007 ? ;-)

We are currently trying to address the memory retention issue that using File.deleteOnExit() causes (cf. https://bugs.openjdk.java.net/browse/JDK-4872014) and we would like to export all the strings that the LinkedHashSet of java.io.DeleteOnExitHook holds, in order to figure out which file name patterns are the most offending and whether a punctual fix would be enough in the short term.

As of YourKit 2016.02-b43, the "Open collection elements in a new tab" link only shows the 500 first (?) elements, with no way to display more elements, or export them, etc.

How could we do that (or something similar) ?

Thanks in advance for your answer !
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Anton Katilin »

There is no dedicated UI for this purpose yet, sorry.

As a workaround, please specify the property (with even bigger value, if necessary) -Dyjp.max.objects.to.show=100000 in <user home>/.yjp/ui.ini
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

Seems to work like a charm, and a parameter is fine enough : thanks !
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

Hi !
It looks like this parameter is longer working, and it has been so for at least the past 2 years... Or did I miss something ?
How can we increase the number of displayed elements, nowadays ?
Thanks in advance for your answer !
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

Yannis wrote:this parameter is longer working
Grmpf... I meant NO longer working! ;-)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Anton Katilin »

Hello Yannis,

The property has been renamed. Please use -Dyk.max.objects.to.show=N instead.

Best regards,
Anton
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

That works !
What about adding some interactive [load more...] hyperlink, or something like that ? ;-)
Thanks for your answer !
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Anton Katilin »

Thank you for the confirmation.
What about adding some interactive [load more...] hyperlink, or something like that ?
Would it be practically useful to manually inspect thousands of individual objects in the "Object explorer" list?

The UI offers different ways to reduce the object set to browse. For example, the filter field above the list. Normally you have a few objects to browse only.

Could you please describe your case. What kind of objects do you want to browse as a list? Did you pre-filter them somehow e.g. by class, field value etc? How do you find among them the object(s) of interest?
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

Well, I'm currently analyzing an excessive RSS size of several times the heap (=> same default value for -XX:MaxDirectMemorySize and the equivalent for Netty's own allocator), so I wanted to check whether all of these DirectMemoryBuffers all had the same capacity, which could hint towards an issue with Netty...
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Anton Katilin »

I think that the following features might be helpful in this case:
1. The memory inspection "NIO direct buffers native memory usage".
2. Opening all java.nio.DirectByteBuffer in Object explorer (Ctrl+N) and sorting by the "Name" column in different directions to see the maximal and minimal value.
3. Action "Memory | Objects by Field Value" (Ctrl+Shift+F) with given range of "capacity" to see how the number of found objects corresponds to the total number of the buffers.
Yannis
Posts: 20
Joined: Wed Oct 02, 2013 10:07 am

Re: 500 elements limit for arrays in "Object explorer"

Post by Yannis »

I haven't had the opportunity to check your recommendations but thanks for them : I'll keep that in mind !
Locked