[Design of JBoss Profiler] - Re: Class Leakage Tool
by clebert.suconic@jboss.com
"ngolovin" wrote :
| What you are suggesting is exactly what I did. I saw the matrix and the duplicates. Then I clicked on loader references and saw there approx. 2000 references (I have removed the 200-reference limit in my copy of the references.jsp)
|
What I do is...
I - I always look for the classLoader reference.
It's hard to create a filter for this. I couldn't come up with a logic, as sometimes a third level is what's causing a leakage. For example if you keep a reflection reference, you will have:
reflectionObject->class->ClassLoader
And this is really hard. If you have a classLoader loading 2000 classes, and only one class is kept referenced, all the 2000 classes will still be in the memory because of the ArrayList on ClassLoader. (read source code from JDK you will know what I'm talking about).
Try looking at field references first. Than move to another level.
Also.. when you said about parent classLoaders, I didn't understand what you meant. But what usually happens is a class or an instance of that class, loaded by any different classLoader keeping directly or indirectly a reference to your classLoader.
an example is Commons Logging. (if you're not using our patched version)
CommonsLogging will keep a HashMap of Loggers using Class as the key.
Class has the reference to the classLoader and CommonsLogging is loaded from System ClassLoader.
I don't know if this helps...
But... as I said before.. .chasing a redeployment leakage is never fun, even if you were using the most expensive tool.
Clebert Suconic
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967515#3967515
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967515
18 years, 1 month
[Design of JBoss Profiler] - Re: Class Leakage Tool
by ngolovin
Hi Clebert, either I have expressed myself way too vaguely, or you answer was for another thread.
What you are suggesting is exactly what I did. I saw the matrix and the duplicates. Then I clicked on loader references and saw there approx. 2000 references (I have removed the 200-reference limit in my copy of the references.jsp)
My problem is, I am looking for the reference, which prevents the my ClassLoader from being collected by the GC.
Do you have any suggestions on how to find this reference? As far as I understand, this reference will not be coming from the classes, which were loaded by that ClassLoader, but should come from classes loaded by parent classloaders. Is it possible to put a filter on references to show only references from classes, loaded by parent classloaders? If you have an ideea how to implement it in Java, I could implement it myself. I don't even have a clue, how to find out which classloader loaded a particular class.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967510#3967510
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967510
18 years, 1 month
[Design of JBoss ESB] - Re: Registry Design
by tfennelly
Hey Mughdo, sorry for being so slow in replying. I had some serious laptop issues - all sorted now though!!
I spent some time this morning looking at these reg specs - JAXR, UDDI etc. What's outlined in the JAXR spec def seems to be more inline with the direction that Mark wants us to take (as I understand it ;-) ). I'm talking mainly about the data model!! See the UMLs for an idea of the type of relationships.
In the JAXR model, it has the concept of:
- A RegistryObject which acts as a base type for everything that's stored in the registry.
- Numerous specialisations of ServiceObject that I think are relavant to anything we'd be doing wrt a regsitry interface. These include: Service, ServiceBinding, Classification (and related types!) and more...
In order to access these RegistryObjects JAXR defines the QueryManager interface. We'll need something along the lines of this interface too.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967493#3967493
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967493
18 years, 1 month