Looking through the Visual VM OQL documentation , I have no impression that it supports Java method calls, but only Java fields. (Some of their examples include .toString() , but this is clearly JavaScript .toString() , not Java, as they use it to convert a Java String object to a JavaScript string). So, for example, all-string examples use the private field count , not the public method length() , and the length-vector example uses the private field elementCount , not the public method size() .
So, the error you get is that ConcurrentHashMap does not have a field called size .
Unfortunately, for your request, ConcurrentHashMap does not save its size in the field - which would jeopardize its ability to avoid blocking - so I think you will have to write something like this:
select { map: x } from java.util.concurrent.ConcurrentHashMap x where sum(x.segments, 'it.count') < 10
to summarize all segment sizes yourself. (Disclaimer: 100% completely unverified.)
ruakh source share