Getting this weird error:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: size is not a function, it is null. (#1)
While analyzing a heap dump and running this OQL query on VisualVM:
select { map: x }
from java.util.concurrent.ConcurrentHashMap x
where x.size() < 10
The problem lies on the where
clause, somehow it's not working though Map
obviously has a size method.
@ruakh's answer is preety good, except one little thing. A segment sometimes could be null, which messes up sum(x.segments, 'it.count')
. Replace it with
sum(x.segments, 'it != null ? it.count : 0')
and it will work fine. Tested upon my word.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With