• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Finalization changed in JLS?

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read the following about finalization:
http://java.sun.com/docs/books/jls/class-finalization-rationale.html
Does this mean that finalization has been removed from the JLS??? Or is this arguing that it should be? I know that the JDK and other compilers recognize the finalize methods, but are they just empty method bodies right now? Can one of our great byte code specialists check into this??
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. This only refers to finalization of classes - we still have finalization of objects. Finalization of a class is something that would have occurred prior to the unloading of an entire class, which only happens when there are no instances of a class anywhere and the JVM basically decides it no longer needs to remember what this class is and how it works. (Of course, it could decide to reload the class later.) This most commonly applies to anonymous classes - once the single instance of an anonymous class is collected, the JVM might as well forget the whole definition of the anonymous class as well.

[This message has been edited by Jim Yingst (edited April 05, 2000).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Jim! So you are saying, as a programmer you probably won't ever see this or worry about it, right? It sounds as if it would only concern people writing compilers etc.
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically, yeah. And the point of the original article was that they originally had class finalization in Java, but as of 1.1 they took it out. So you're pretty definitely not going to ever deal with it unless they for some reason decide to put it back in.
The related concept of class unloading is still in Java, but most people probably will never need to pay much attention to it. It might be an issue if you're using too much memory and are trying to understand where all it's being used, and which parts are being freed, etc.
reply
    Bookmark Topic Watch Topic
  • New Topic