Meaningless Drivel is fun!*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Change in Constructor and Finalize method" Watch "Change in Constructor and Finalize method" New topic

Change in Constructor and Finalize method


Joined: Feb 16, 2002
Posts: 19

I want to track the number of objects created and number of objects finalized. Hence, I have made changes in 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

Joined: Jul 08, 2003
Posts: 24183

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:
subject: Change in Constructor and Finalize method
Similar Threads
Convert SQL to Criteria please
count the number of objects
Pass by Value (Method arguments)
"Number Of Objects in Heap"
reusability of object