-2

my question is, i have objects in the generation 0, and i also overridden the finalization method.

When the gc collects the gen0, sees that it has to finalize to, so doesn't releases them immediatly, and promotes these objects to gen1? Therefore these will only be realeased if the gc collects gen1. Assuming these objects will not be used again, they are garbage

thanks!

Franmcod
  • 319
  • 4
  • 12

1 Answers1

5

Finalize methods are called at the completion of a garbage collection on objects that the GC has determined to be garbage. This means that the memory for these objects cannot be reclaimed right away because the Finalize method might execute code that accesses a field. Because a finaliz- able object must survive the collection, it gets promoted to another generation, forcing the object to live much longer than it should. Richter j. -CLR via C#

so yeah, it get's promoted :)

Franmcod
  • 319
  • 4
  • 12