• 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

Difference between Class Unloading and Object Finalization

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Like to know the difference between Class Unloading and Object Finalization.
-------------------------------------------------------------------------------------------------------------------------------------------------
My Understanding:
Among many cases,one case is:

A class gets unloaded after all its instances gets Finalized (i.e finalize() ).


-------------------------------------------------------------------------------------------------------------------------------------------------
Scenario:
But in case of Message Driven Bean, i see that MDB class gets unloaded but still MDB objects are available in pool.
--------------------------------------------------------------------------------------------------------------------------------------------------
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Finalization is something which happens to an object, when it is garbage-collected and deleted from memory. There may be other instances of that class still reachable.
Class unloading occurs when the JVM detects there are no more uses for that class. Obviously first all instances of that class will have to be (at least eligible to be) garbage-collected.
 
suresh livingston
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

However, in my MDB case, dont know why MDB class is getting unloaded first while still its instances are being alive in the pool..
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know. Maybe somebody else will know.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic