[Issue 2757] resource management in a timely manner

dsimcha dsimcha at yahoo.com
Thu Apr 2 21:19:36 PDT 2009


== Quote from Sean Kelly (sean at invisibleduck.org)'s article
> d-bugmail at puremagic.com wrote:
> >
> > ------- Comment #2 from maxmo at pochta.ru  2009-04-02 07:50 -------
> > This guy wants gc to free "unmanaged" resources each 10 seconds, because if gc
> > objects, wrapping those resources, don't occupy much space, gc won't bother to
> > collect garbage.
> The I suggest creating a thread that calls GC.collect() and then sleeps
> for ten seconds in a loop.

Come to think of it, as simple and kludgey sounding as it is, this is an
incredibly good idea if you have an app that does a lot of sitting around waiting
for input, etc. and therefore not allocating memory and you want an easy way to
make sure it releases resources in a reasonable amount of time.  This belongs in
an FAQ somewhere.


More information about the Digitalmars-d-bugs mailing list