Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » OQL: find objects with no inbounds from package
OQL: find objects with no inbounds from package [message #6854] Sun, 09 November 2008 14:22 Go to next message
Bernd Eckenfels is currently offline Bernd Eckenfels
Messages: 8
Registered: July 2009
Junior Member
In order to find JbossMQ Connections (org.jboss.mq.SpyConnection) which
have been lost, I would like to check those which do not have inbound
references from some of my classes.

select * from org.jboss.my.SpyConnection c where
classof(inbounds(c).get(0)) = "com.example.*" or
classof(inbounds(c).get(1)) = "com.example.*" or
classof(inbounds(c).get(2)) = "com.example.*"

However the "=" operator does not work in this case and there seems to be
no "instanceof" operator for where. I would also like to use a
"contains()" method on the inbounds() array in order to avoid specifyin
1-5 get()s.

Also the other way around is not cleat to me, SpyConnection has a ref
attribute called clientILService and it can point to a instance of
org.jboss.mq.il.uil2.UILClientILService or others. And I want to select
all of that typle:

select * from org.jboss.mq.SpyConnection c where
classof(c.clientILService) = org.jboss.mq.il.uil2....

Any way to do this in OQL?

Greetings
Bernd
Re: OQL: find objects with no inbounds from package [message #6878 is a reply to message #6854] Sun, 09 November 2008 14:30 Go to previous messageGo to next message
Bernd Eckenfels is currently offline Bernd Eckenfels
Messages: 8
Registered: July 2009
Junior Member
Bernd Eckenfels wrote:
> Also the other way around is not cleat to me, SpyConnection has a ref
> attribute called clientILService and it can point to a instance of
> org.jboss.mq.il.uil2.UILClientILService or others. And I want to select
> all of that typle:

> select * from org.jboss.mq.SpyConnection c where
> classof(c.clientILService) = org.jboss.mq.il.uil2....

> Any way to do this in OQL?

I found this part myself:

SELECT * FROM org.jboss.mq.SpyConnection c where
classof(c.clientILService).getName() =
"org.jboss.mq.il.jvm.JVMClientILService"
Re: OQL: find objects with no inbounds from package [message #6899 is a reply to message #6854] Sun, 09 November 2008 14:59 Go to previous messageGo to next message
Bernd Eckenfels is currently offline Bernd Eckenfels
Messages: 8
Registered: July 2009
Junior Member
Bernd Eckenfels wrote:

> In order to find JbossMQ Connections (org.jboss.mq.SpyConnection) which
> have been lost, I would like to check those which do not have inbound
> references from some of my classes.

> select * from org.jboss.my.SpyConnection c where
> classof(inbounds(c).get(0)) = "com.example.*" or
> classof(inbounds(c).get(1)) = "com.example.*" or
> classof(inbounds(c).get(2)) = "com.example.*"

I found a query which works (not for local references) but it is pretty
ugly:

SELECT c, toString(c.clientID), inbounds(c).length FROM
org.jboss.mq.SpyConnection c WHERE
(((inbounds(c).length>4) and
(classof(inbounds(c).get(0)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(1)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(2)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(3)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(4)).getName().startsWith("com.example ")!=true))or
((inbounds(c).length>3) and
(classof(inbounds(c).get(0)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(1)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(2)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(3)).getName().startsWith("com.example ")!=true))or
((inbounds(c).length>2) and
(classof(inbounds(c).get(0)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(1)).getName().startsWith("com.example ")!=true)and
(classof(inbounds(c).get(2)).getName().startsWith("com.example ")!=true)))

any idea?


> However the "=" operator does not work in this case and there seems to be
> no "instanceof" operator for where. I would also like to use a
> "contains()" method on the inbounds() array in order to avoid specifyin
> 1-5 get()s.

> Also the other way around is not cleat to me, SpyConnection has a ref
> attribute called clientILService and it can point to a instance of
> org.jboss.mq.il.uil2.UILClientILService or others. And I want to select
> all of that typle:

> select * from org.jboss.mq.SpyConnection c where
> classof(c.clientILService) = org.jboss.mq.il.uil2....

> Any way to do this in OQL?

> Greetings
> Bernd
Re: OQL: find objects with no inbounds from package [message #6924 is a reply to message #6899] Mon, 10 November 2008 15:59 Go to previous message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
Hi Bernd,

that looks particular ugly...

I CANNOT make it work either. I tried the following statements but it does
NOT work (yet). I will make it work for the next version, but that is not
helping you now.

SELECT * FROM java.util.HashMap map
WHERE (SELECT * FROM OBJECTS
${snapshot}.getInboundRefererIds(map.getObjectId()) inbound
WHERE classof(inbound).getName().startsWith("java.util.")).size() >
0


If you are still interested, you'd be able to write Java code to traverse
the object graph. It requires a little bit of Eclipse know-how and some
Java. Let me know and I can provide some sample code.

Andreas.
Previous Topic:What does Thread Status mean
Next Topic:Problems checking out src
Goto Forum:
  


Current Time: Wed Oct 01 06:13:23 GMT 2014

Powered by FUDForum. Page generated in 0.14865 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software