Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mat-dev] Find Class object by class name

Hi,

There is also a specific query which could be helpful. You can find it in the query browser under  "Java Basics" -> "Duplicate Classes".

This will list all the classes which are present more than once, and for each of them you'll see all the classloaders. 
You can filter for specific classes if you want.

>From there you can directly call "Paths from GC roots" on the classloaders to see what is keeping them alive.

I found this approach useful in many cases so far.

Krum

-----Original Message-----
From: mat-dev-bounces@xxxxxxxxxxx [mailto:mat-dev-bounces@xxxxxxxxxxx] On Behalf Of Dacong Yan
Sent: Mittwoch, 5. November 2014 00:57
To: Kevin Grigorenko
Cc: Memory Analyzer Dev list
Subject: Re: [mat-dev] Find Class object by class name

Thanks, Kevin. This is exactly what I'm looking for. Using OQL is
elegant to me, except that I never get the chance to learn the
language.

On Tue, Nov 4, 2014 at 3:51 PM, Kevin Grigorenko
<kevin.grigorenko@xxxxxxxxxx> wrote:
>
> I don't know of an elegant solution, but here are a few ideas:
>
> 1. Open Query Browser > List Objects > with outgoing references > Check "include class instance", although you will also get all instances.
>
> 2. Using OQL:
>
> SELECT OBJECTS c FROM INSTANCEOF java.lang.Class c WHERE c.@displayName.contains("class org.apache.commons.logging.impl.Jdk14Logger ")
>
> --
> Kevin Grigorenko
> IBM WebSphere Foundation SWAT Team
> kevin.grigorenko@xxxxxxxxxx
> Blog: https://www.ibm.com/developerworks/mydeveloperworks/blogs/kevgrig/?lang=en
>
>
> Dacong Yan ---11/04/2014 03:59:18 PM---Hi, I'm using MAT to debug a permgen memory leak. I have found it a
>
>
> From:
>
>
> Dacong Yan <tonywinslow1986@xxxxxxxxx>
>
> To:
>
>
> mat-dev@xxxxxxxxxxx
>
> Date:
>
>
> 11/04/2014 03:59 PM
>
> Subject:
>
>
> [mat-dev] Find Class object by class name
>
> Sent by:
>
>
> mat-dev-bounces@xxxxxxxxxxx
> ________________________________
>
>
>
> Hi,
>
> I'm using MAT to debug a permgen memory leak. I have found it a
> constant pain to find Class objects by class name - I have to start
> from the leaking classloader and click all the way through.
>
> Question: say, I suspect there are two copies of A.class, how can I
> find all the A.class objects? In other words, how can I find all the
> Class objects who represent the class A?
>
> Thanks,
> Tony
> _______________________________________________
> mat-dev mailing list
> mat-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/mat-dev
>
>
>
_______________________________________________
mat-dev mailing list
mat-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mat-dev


Back to the top