Re: Thoughts on memory freeing
- From: gremnebulin <peterdjones@xxxxxxxxx>
- Date: Wed, 30 Jul 2008 02:27:22 -0700 (PDT)
On 29 Jul, 16:36, "S James S Stapleton" <stapleton...@xxxxxxx> wrote:
"santosh" <santosh....@xxxxxxxxx> wrote in message
news:g6nd3o$omb$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
S James S Stapleton wrote:
In languages, you end up having 'garbage collecting' methods for
freeing memory, and the other kind (I don't know the term off the top
of my head, but it's seen in C/C++ and done by directly calling the
memory deallocation function).
One term you can use is manual memory management, as opposed to Garbage
Collection whose whole purpose is to automate the task of deallocation.
There's arguments as to which is better for a program, and a lot of
what I've seen points to the GC methods.
If your language supports GC and you can accept some of it's
shortcomings, then GC certainly frees you from what would otherwise be
tedious accounting and not directly related to the problem that the
program tries to solve.
If you are using a language
where GC is nontrivial, would it be advantage to have a memory
deallocation thread? By that I mean, rather than directly deallocate
(i.e. a free call), call something which will put the memory free'ing
on another thread (either by placing it on a to-be-deleted queue -
which would have delays due to locks/mutexes, or by running each
deallocation in it's own thread - which would have the thread creation
overhead).
You would be reimplementing a lot of the functionality of your
language's "free" routine by doing this, unless of course your language
is primitive enough to not provide them in the first place.
Oh, I was thinking of just calling 'free' in it's own thread as the main
implementation idea. I take it the system's free implementation probably
already does this?
You need to track what needs freeing. Free() is uncodinitional. Some
implemetnations crash if
you free the same memeory twice, too.
.
- References:
- Thoughts on memory freeing
- From: S James S Stapleton
- Re: Thoughts on memory freeing
- From: santosh
- Re: Thoughts on memory freeing
- From: S James S Stapleton
- Thoughts on memory freeing
- Prev by Date: Re: Algorithm to achieve this result?
- Next by Date: Loop-dedicated benchmark suites?
- Previous by thread: Re: Thoughts on memory freeing
- Next by thread: Loop-dedicated benchmark suites?
- Index(es):
Relevant Pages
|