Relative Content

Tag Archive for garbage-collection

Which part of the Memory is used for the Garbage Collector?

I understand the Heap memory divisions such as Young, tenured and Perm Gen.
But I’m just curious from where is the memory used for performing the Garbage Collector itself? Is it from any of these memory spaces or in the thread stacks ?

Is it appropriate to try to control the order of finalization?

I’m writing a class which is roughly analogous to a CancellationToken, except it has a third state for “never going to be cancelled”. At the moment I’m trying to decide what to do if the ‘source’ of the token is garbage collected without ever being set.

When to use weak references in .Net?

I have not personally come across a situation where I’ve needed to use WeakReference type in .Net, but the popular belief seems to be that it should be used in caches. Dr Jon Harrop gave a very good case against the use of WeakReferences in caches in his answer to this question.

Is Non-Deterministic Resource-Management a Leaky Abstraction?

From what I can see, there are two pervasive forms of resource-management: deterministic destruction and explicit. Examples of the former would be C++ destructors and smart pointers or Perl’s DESTROY sub, whilst an example of the latter would be Ruby’s blocks-to-manage-resources paradigm or .NET’s IDispose interface.