Orchid XP v7 <voi### [at] devnull> wrote:
> Letting go of a
> pointer to a file handle causes the file to be closed WHEN THE GC RUNS,
> however exhausting the OS handles limit does not trigger the GC...
This is exactly one of my points in my "I hate Java" page. Garbage
collection is good when the resource is memory, but memory is not the
only resource you can allocate. In some cases (as this one) you have
to free the resource *immediately* when it's not needed anymore, else
malfunction can happen.
Of course in good modular programming it's the same module which
reserved the resource which should take care of freeing it when it's
not needed anymore. Having to manually call some cleanup function from
the outside breaks modularity.
What I wonder is why everyone talks like there wouldn't be any negative
sides to GC.
--
- Warp
Post a reply to this message
|