File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Change in Constructor and Finalize method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Change in Constructor and Finalize method" Watch "Change in Constructor and Finalize method" New topic
Author

Change in Constructor and Finalize method

KRISH DOSS
Greenhorn

Joined: Feb 16, 2002
Posts: 19
Hello,

I want to track the number of objects created and number of objects finalized. Hence, I have made changes in java.lang.Object.java and moved the compiled class into boothpath. But, I am getting 'StackOverFlowError'. Is there any alternative way of doing this?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

There are certainly better ways, yes. There's a whole JVM debugger interface that can tell you this information, and Tiger (Java 5) has some great monitoring tools that come with it.

But what you tried to do should be workable; it would throw a StackOverflowException, though, if your overrides actually allocate (directly or indirectly) any objects.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change in Constructor and Finalize method
 
Similar Threads
"Number Of Objects in Heap"
Pass by Value (Method arguments)
Convert SQL to Criteria please
count the number of objects
reusability of object