Python Memory Manager

Pie Squared PieSquared at gmail.com
Sun Feb 17 15:00:14 EST 2008


On Feb 17, 1:57 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Pie Squared <PieSqua... at gmail.com> writes:
> > Also, if it does, how does it deal with memory segmentation? This
> > question bothers me because I've been trying to implement a moving
> > garbage collector, and am not sure how to deal with updating all
> > program pointers to objects on the heap, and thought perhaps an answer
> > to this question would give me some ideas.
>
> As I understand it, Python primarily uses reference counting, with a
> mark and sweep scheme for cycle breaking tacked on as an afterthought.
> It doesn't move objects in memory during GC so you can get
> fragmentation. It's probably not feasible to change this in CPython
> without extensive rewriting of CPython and maybe a lot of external C
> modules.
>
> > (Also, if you know any
> > resources for things like this, I'd be grateful for links/names)
>
> If you mean about GC in general, the old book by Jones and Lins is
> still standard, I think.

Thanks for the quick reply!

That answered my question, and I'll check out the book  you're
referring to - it's exactly what I need, I think. Again, thanks!



More information about the Python-list mailing list