VisualVM 1.3.8 OQL - TypeError: [RegExp /java.lang./] is not a function

230 views Asked by At

When executing below OQL, it gives TypeError: [RegExp /java.lang./] is not a function

select filter(heap.classes(), "/java.lang./(it.name)") 

Should that work? Refer to OQL all instances from a package

Also, may I know if OQL is a "standard" for analyzing heap dump?

1

There are 1 answers

0
James_pic On

It seems that:

select filter(heap.classes(), "/java.lang./.exec(it.name)") 

works. My OQL-foo is not that strong, but I'd hazard a guess that it relates to Javascript error regex not a function?.

Update

I seem to be able to reproduce the issue on Java 8 (which uses Nashorn), but not on Java 7 or below (which uses Rhino). This makes sense, as Nashorn implements the ES5 behaviour where RegExp is not a function, whereas Rhino implements the old Mozilla behaviour, where is it.