This content has been marked as final. Show 2 replies
"Overallocated String" means a string which effective data (denominated by its "offset" and "count" properties) take less space than allocated by its "value"
Regarding the second part of your question - what do you mean by all strings/chars belonging to a class? Could you elaborate the usecase?
Thanks for your answer,
I understand now the meaning of overallocated in that sense,
the use-case for the search that I would like to perform in the Query Console is:
I made a HEAP-Dump using VisualVM, now I analyze the Heap-Dump.
char is the biggest memory consumer in that HEAP-Dump. Each char has some references, if you click through those references at some point you will reach a class that is part of my code.
Now I would like to find out which classes do have the upmost consumers of "char" references in the HEAP-Dump.
For example I have a class ErrorEvaluatorAsciiText that has an attribute "String" now I want to search the heap if there is any (and how many / size) of that String stored in the HEAP-Dump.
Select count(s) from java.util.char where s.reference=ErrorEvaluatorAsciiText
I can perform a query like:
select o from char o where o.rererence=String
but I can't do any query like:
select o from java.lang.String o where o.rererence=StromElement
=> But actually of course the interesting part for me is to see how many string-instances of the current heap have referals this class.
or for example:
select o from int o where o.rererence=SimpleVisitable
select o from int o where o.rererence=priorityWasSetForVisitNr
But actually from the VisualVM "Instances" view I can see that there is at least one int that has Type SimpleVisitable or Field priorityWasSetForVisitNr as reference.
Even better of course would be a query that gives me the top10 references of char in my code...
Hope this explains my problem ...