aspose file tools*
The moose likes Java in General and the fly likes List of Objects in the JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "List of Objects in the JVM" Watch "List of Objects in the JVM" New topic
Author

List of Objects in the JVM

Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Is there any way - through java - to find out the list of Objects that are present in the JVM at a particular point of time.

I know that the profilers can do this job. But, I want to know if we can do it ourselves someway through java.

Any insight on how the profilers work will also be appreciated.


They say you have to be the first, the best or different. I say, is it too much to ask for all three.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

Profilers and debuggers usually use a special API that the JVM provides: JVM TI (Java Virtual Machine Tool Interface).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Yes, Profilers and debuggers user special APIs. Is there any way we can achieve this with just core java programming.

For example, we can monitor the heap usage of the JVM through simple java methods. Is there any similar way to find what all objects exist in the JVM.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

No, there isn't, as far as I know.
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Jesper Young wrote:No, there isn't, as far as I know.


I've never heard either. Such complicated thing in a so easy way... =/


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Hi Jesper,
Can you move this thread to Performance. May be someone else might have ideas.
Thanks.
Sriram Naga
Greenhorn

Joined: Aug 24, 2010
Posts: 8
Are you referring to the use of hprof?

Please have a look at this Sun article.

http://java.sun.com/developer/technicalArticles/Programming/HPROF.html


[My Page] | [JavaRanch FAQ] | SCJP6

"I am not afraid of the storm, as I am learning to sail my ship"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Sandeep Sanaboyina wrote:Can you move this thread to Performance.

As this is not a performance question, why would that make sense?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List of Objects in the JVM