This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there any means to check the number of objects created when a java prgram runs.

 
Vinoth Maharaj
Greenhorn
Posts: 3
Android Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to check the number of objects created by this java program.

class Test{

public static void main(String args[]){
System.out.println("Hello World !");
}

}
 
Jayesh A Lalwani
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use any profiler. I believe VisualVM can show you the objects. Or if you don't want to download anything, you can use JMXConsole to take a heap dump
 
Tina Smith
Ranch Hand
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't VisualVM come with the JDK?
 
Alfred Peterson
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been used VisualVM but not for counting number of objects. I think, you can use it.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question has been answered before.

http://www.coderanch.com/t/329407/java/java/find-all-loaded-classes-classloaders
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic