| Author |
Infinite loop or deadlock in finalize()
|
Victor Ho
Ranch Hand
Joined: Sep 05, 2003
Posts: 74
|
|
I am curious what would happen when you have an infinite loop or deadlock in finalize(). My guess is that the daemon GC thread will get hung up and as time goes on, heap space runs out which leads to OutOfMemory exception. Any thoughts or more accurate knowledge on this? Thanks Victor
|
 |
James Carman
Ranch Hand
Joined: Feb 20, 2001
Posts: 580
|
|
Why not try it yourself...
|
James Carman, President<br />Carman Consulting, Inc.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
I debugged one of these, quite a few years ago. It was a CORBA program (on OrbixWeb) and somebody indirectly made a network call in finalize(). This led to a deadlock, and a messy debugging problem in a server process. We eventually had a rule that you couldn't write finalize() in any class on that project.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: Infinite loop or deadlock in finalize()
|
|
|