[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Frantic (again)



Here's the link to the patch.  I made a comment in there about it.
http://sourceforge.net/tracker/index.php?func=detail&aid=1123430&group_id=5470&atid=305470

It says there that it was merged into the trunk in March.

Thanks for that example.  It does seem to work when freeing lists.
For dictionaries it releases some memory, but not all of it.  For both
cases it is certainly much better than python2.4, but not as good.
The processes in my tests still are at 30MB after things are del'd.
With 2.4 they remain using 240MB+ of memory.

Yeah, that's what I'm talking about for C programs... I think.  I
can't find the explanations I've read about it.  However you can see
the behaviour with C programs by test.


Cheers,


On 6/30/06, Brian Fisher <brian@xxxxxxxxxxxxxxxxxxx> wrote:
On 6/29/06, René Dudfield <renesd@xxxxxxxxx> wrote:
> I just tested this with python2.5 beta 1, and it does not free all of
> the memory.  So I guess this bug is not yet fixed after all.
>
thanks for checking that out - I am curious about this whole thing

I looked at the post about the patch closer
(http://mail.python.org/pipermail/python-dev/2006-March/061991.html)
and it looks like it was put on a branch in earlry march, so I suppose
it might not be in the Beta (still on the branch)?

Or maybe it's in, but many arena's could still not be freed due to
allocated objects in them?

So what kind of memory usages before and after were you seeing? (I saw
155MB before and 124MB after in task manager on python 2.3 WinXP with
the 10mil element list)


> I also tried it with some large dicts. No goodness. > I assume you mean the mem wasn't freed...? (from what I could tell reading about the mem pools, the allocation for dictionary elements and list elements are pooled, so I guess that's consistent with no patch)


This is the test that Tim Peters posted as a way to see the effectiveness of the patch to the python mailing list, so I assume if this one still frees very little, the patch must not be in

x = []
for i in xrange(1000000):
   x.append([])
raw_input("full ")
del x[:]
raw_input("empty ")

when it's "full" I see 39MB, when it's "empty" I see 34MB in the task
manager, all with python 2.3 WinXP


> Also note that C programs can not free certain amounts of memory too. > I assume that what you are talking about here is that the OS allocates memory in chunks larger then the c libraries allocation routines do, so free'd memory won't be returned to the OS until all allocated memory in the block is free (which is basically the same situation that the python arena allocation that the patch will implement)