Python memory usage
mike.klaas at gmail.com
Mon Nov 13 21:44:28 CET 2006
> On Nov 9, 8:38 pm, "Klaas" <mike.kl... at gmail.com> wrote:
> > I was referring specifically to abominations like range(1000000)
> However, there are plenty of valid reasons to allocate huge lists of
I'm sure there are some; I doubt there are plenty. Care to name a few?
> This issue has been worked on:
> My understanding is that the patch allows most objects to be released
> back to the OS, but can't help the problem for integers. I could be
Integers use their own allocator and as such aren't affected by Evan's
> mistaken. But on a clean Python 2.5:
> The problem exists for floats too, so for a less contrived example:
> x=[random.weibullvariate(7.0,2.0) for i in xrange(10000000)]
> Both leave the Python process bloated in my environment. Is this
> problem a good candidate for the FAQ?
I think floats use obmalloc so I'm slightly surprised you don't see
differences. I know that evan's patch imposes conditions on freeing
obmalloc arenas, so you could be seeing effects of that.
More information about the Python-list