This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change in Constructor and Finalize method

 
KRISH DOSS
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic