Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
abinashsamal@gmail.com - 17 Mar 2007 07:30 GMT
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.

--
Regards,
Abinash Samal
Tom Hawtin - 17 Mar 2007 09:05 GMT
> 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
Xiaochuan Fang - 17 Mar 2007 09:11 GMT
Have you ever tried "java -verbose ..."

abinashsamal@gmail.com 写道:
> Hi,
>
[quoted text clipped - 7 lines]
> Regards,
> Abinash Samal
Ingo R. Homann - 19 Mar 2007 10:33 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.