which all classes are running in jvm at a given moment?

A

abinashsamal

Hi,

Is there any way to know which all classes are running in jvm at a
given moment? Actually the problem is, I am working on a java
application, and I am not able to trace out which class has the code
for some functionality. I have tried putting break-points to reach the
class but not able to trace.
 
T

Tom Hawtin

Is there any way to know which all classes are running in jvm at a
given moment? Actually the problem is, I am working on a java
application, and I am not able to trace out which class has the code
for some functionality. I have tried putting break-points to reach the
class but not able to trace.

Ctrl-\ (or Ctrl-Break on Windows) from the console will dump the stacks
of all threads. Or use any old debugger. Or the jstack command. From
within code, Thread.dumpStack() will dump the current stack. For all
threads you can use java.lang.management (since 1.5).

Tom Hawtin
 
I

Ingo R. Homann

Hi,

Is there any way to know which all classes are running in jvm at a
given moment?

What do you mean with "a class is running"? That seems to be an easy
question, but indeed, it isn't! Classes are *never* "running". A Thread
is running. And a Thread might be running in a pice of code that is
definded in a class. Or a Thread might access some data that is defined
in a class. A Thread might access some data that references another
class. A class might have been "used" (in the manner described above)
some time ago and might be in memory but isn't used any longer (is this
class "running"?)...

What do you mean?

Ciao,
Ingo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top