Python Memory Manager

thebjorn BjornSteinarFjeldPettersen at
Sun Feb 17 22:25:57 CET 2008

On Feb 17, 10:01 pm, Pie Squared <PieSqua... at> wrote:
> It seems to me that another, perhaps better strategy, would be to
> allocate a large heap space, then store a pointer to the base of the
> heap, the current heap size, and the beginning of the free memory.
> When you need to 'allocate' more room, just return a pointer to some
> location in the heap and increment the start-of-free-memory pointer.
> That way, allocation really IS free, more or less. Wouldn't that be
> more efficient? Perhaps I'm missing something.


> As a side note, I'm new to Usenet, so I'm not exactly sure... are
> 'tangents' like this - since this IS a Python newsgroup, after all -
> okay?

It varies depending on the group, is pretty tolerant as long as
it's interesting ;-)

To bring it back to Python, I was under the impression that the GC was
a generational collector and not a simple mark-sweep, but it's been a
while since I read about it...

-- bjorn

More information about the Python-list mailing list