Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

Grant Edwards invalid at invalid.invalid
Sat Mar 9 20:18:59 CET 2013

On 2013-03-09, Wong Wah Meng-R32813 <r32813 at> wrote:

Your entire post is in your signature block. Don't do that. Many
people have newsreaders or e-mail clinets configured to hide or ignore
signature blocks.

>Yes I have verified my python application is reusing the memory (just
>that it doesn't reduce once it has grown) and my python process
>doesn't have any issue to run even though it is seen taking up more
>than 2G in footprint.

Then there's nothing wrong with Python.

>My problem is capacity planning on the server whereby since my python
>process doesn't release memory back to the OS,

In Unix there is no way to release heap memory (which is what you're
talking about) back to the OS except for terminating the process.

>the OS wasn't able to allocate memory when a new process is spawn off.

You need to either get more memory, change your Python program to use
less memory, or have your Python program terminate in order to return
memory to the OS.

Perhaps you can put the memory hungery portion of your processing into
a subprocess that terminates when it's completed its work?

Grant Edwards               grant.b.edwards        Yow! Don't hit me!!  I'm in
                                  at               the Twilight Zone!!!

More information about the Python-list mailing list