Monday, January 30, 2012

I'm at it again. ReentrantLock$NonfairSync seems to be too abundant. I use MAT, which seems to have a somewhat different OQL than jVisualVM (having tried queries that work in one in the other). The MAT OQL pane opens up with a comment '/* press F1 for help */ in the edit area. Pressing F1 brings up no visible help. Maybe the hope of help is supposed to be sufficient?

I seem to have lost some notes from last time -- this doesn't improve the odds so much. Gr.

Reading documentation more, I'm trying things like:

SELECT OBJECTS inbounds(o) FROM (SELECT OBJECTS inbounds(nfs) FROM java.util.concurrent.locks.ReentrantLock$NonfairSync nfs) o
  WHERE classof(o).getName() LIKE "java.util.concurrent.ConcurrentHashMap.*"

Which still doesn't work, but seems closer. I get a ClassCastException with a message 'Remember: sub queries with the modifier INSTANCESOF or INCLUDING SUBCLASSES must return only class objects.'

Hah! That would imply someone told me to start with. So, reading the code a little it appears that subqueries may only return classes (which is a little what that error says, but it leaves room to hope I just did it wrong. No, it appears I can't do it).



However, simplifying to this:

SELECT OBJECTS inbounds(o) FROM (SELECT nfs FROM java.util.concurrent.locks.ReentrantLock$NonfairSync nfs)
  WHERE o.getName() LIKE "java.util.concurrent.ConcurrentHashMap.*"

works no better: Sub-Select must return an object list: (gives the sub select).

So, if sub-selects can only return classes they're really not so useful for me -- I want to select objects by what refers to them.

Have I mentioned that OQL implementations vary? So these nice posts (querying_java_heap_with_oql and permanent_generation_analysis_with_oql) are not so useful. Not to mention that many of their links don't work.