Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #40948
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <isaac.to@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'memory.': 0.05; '(so': 0.07; 'chunk': 0.07; 'exit': 0.07; 'python': 0.09; 'exiting': 0.09; 'fork': 0.09; 'malloc': 0.09; 'objects.': 0.09; 'spawn': 0.09; 'subject:None': 0.09; 'subject:python': 0.11; 'sat,': 0.15; '(just': 0.16; 'allocates': 0.16; 'growing,': 0.16; 'libc': 0.16; 'mmap': 0.16; 'reliably': 0.16; 'wrote:': 0.17; 'memory': 0.18; 'to:name:python-list@python.org': 0.20; 'os,': 0.22; 'subject:release': 0.22; 'idea': 0.24; 'header:In-Reply-To:1': 0.25; '(which': 0.26; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'run': 0.28; 'continually': 0.29; 'url:mailman': 0.29; 'objects': 0.29; 'skip:& 10': 0.29; 'probably': 0.29; 'point': 0.31; 'url:python': 0.32; 'running': 0.32; 'url:listinfo': 0.32; 'allocated': 0.33; 'problem': 0.33; 'to:addr :python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'needed': 0.35; 'returning': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'url:org': 0.36; 'modules': 0.36; "wasn't": 0.36; 'should': 0.36; 'too': 0.36; 'being': 0.37; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'planning': 0.38; 'to:addr:python.org': 0.39; 'release': 0.39; 'short': 0.39; 'application': 0.40; 'url:mail': 0.40; 'your': 0.60; 'easy': 0.60; 'subject:, ': 0.61; 'more.': 0.62; 'back': 0.62; 'different': 0.63; 'more': 0.63; 'choose': 0.65; 'taking': 0.65; 'guaranteed': 0.76; '2013': 0.84; 'computation,': 0.84; 'footprint': 0.84; 'program.\xa0': 0.84; 'subject:Set': 0.91; 'subject:del': 0.91; 'whereby': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=PBWNe9mGOziNlYdRA3cVDx4etZjP8+jPdERCfcYp0os=; b=aKLT0X08JXWdzaWIy3LCoj3RpaxuqWDnknGmvF0qyQFGXQFatZsMIFk3H3FzqbB8E5 BKmPEMG7QZfnJkK/muE8utdZAes5dX+hvXKbRtkkdMcYx6Ow3IEC9P5IhjeOSDvnpaXW HBjbjEv3ThhagWrxsHf7BrpueUMYcyRYhUcYNCaKkJh8HeGjoVobnstfEh1fVxCxHfKB BTwa36IsQeIAwhU8F7E9vOLrZY5TAK8fx9tgcn/gIAHLaNy+Egz94k5FQom5PWrmzrf+ yoC3RmplgAbvTWVzj/etphggRQfdum3dJb1CTK39yLCSmgeEUcSs+DXm6a9lmTNCab3h UUwQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.224.191.68 with SMTP id dl4mr9156986qab.85.1362841337202; Sat, 09 Mar 2013 07:02:17 -0800 (PST) |
| In-Reply-To | <78E1273CA6E76A43BB8830A194FF709B0B157FC9@039-SN2MPN1-013.039d.mgd.msft.net> |
| References | <390f0dc5-5750-4849-9433-a19d90cc8566@googlegroups.com> <87zjyhhret.fsf@nautilus.nautilus> <mailman.2934.1362564689.2939.python-list@python.org> <5137d292$0$30001$c3e8da3$5496439d@news.astraweb.com> <78E1273CA6E76A43BB8830A194FF709B0B14D68C@039-SN2MPN1-013.039d.mgd.msft.net> <CAPTjJmp1qV7vFuT0fB50yHSzbyQagU55MONLbe5W+as6TZ0Csg@mail.gmail.com> <78E1273CA6E76A43BB8830A194FF709B0B153A71@039-SN2MPN1-013.039d.mgd.msft.net> <h41lj8loiudccrragebcrlf05iqtkmnp9f@invalid.netcom.com> <78E1273CA6E76A43BB8830A194FF709B0B157FC9@039-SN2MPN1-013.039d.mgd.msft.net> |
| Date | Sat, 9 Mar 2013 23:02:17 +0800 |
| Subject | Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) |
| From | Isaac To <isaac.to@gmail.com> |
| To | "python-list@python.org" <python-list@python.org> |
| Content-Type | multipart/alternative; boundary=20cf3005dc38ca18e504d77f39a8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3129.1362841346.2939.python-list@python.org> (permalink) |
| Lines | 92 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1362841346 news.xs4all.nl 6888 [2001:888:2000:d::a6]:46041 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:40948 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
In general, it is hard for any process to return the memory the OS allocate to it back to the OS, short of exiting the whole process. The only case that this works reliably is when the process allocates a chunk of memory by mmap (which is chosen by libc if it malloc or calloc a large chunk of memory), and that whole chunk is not needed any more. In that case the process can munmap it. Evidently you are not see that in your program. What you allocate might be too small (so libc choose to allocate it using another system call "sbrk"), or that the allocated memory also hold other objects not freed. If you want to reduce the footprint of a long running program that periodically allocates a large chunk of memory, the "easiest" solution is to fork a different process to achieve the computations that needs the memory. That way, you can exit the process after you complete the computation, and at that point all memory allocated to it is guaranteed to be freed to the OS. Modules like multiprocessing probably make the idea sufficiently easy to implement. On Sat, Mar 9, 2013 at 4:07 PM, Wong Wah Meng-R32813 <r32813@freescale.com>wrote: > > > If the memory usage is continually growing, you have something > else that is a problem -- something is holding onto objects. Even if Python > is not returning memory to the OS, it should be reusing the memory it has > if objects are being freed. > -- > [] 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. My problem is capacity planning on the server whereby since my > python process doesn't release memory back to the OS, the OS wasn't able to > allocate memory when a new process is spawn off. > > -- > http://mail.python.org/mailman/listinfo/python-list >
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 23:45 -0800
Re: sync databse table based on current directory data without losign previous values Lele Gaifax <lele@metapensiero.it> - 2013-03-06 09:19 +0100
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 00:57 -0800
Re: sync databse table based on current directory data without losign previous values Lele Gaifax <lele@metapensiero.it> - 2013-03-06 10:24 +0100
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 01:41 -0800
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 01:43 -0800
Re: sync databse table based on current directory data without losign previous values Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-06 02:15 -0800
Re: sync databse table based on current directory data without losign previous values Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-06 02:15 -0800
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 01:43 -0800
Re: sync databse table based on current directory data without losign previous values Lele Gaifax <lele@metapensiero.it> - 2013-03-06 11:27 +0100
Re: sync databse table based on current directory data without losign previous values Dave Angel <davea@davea.name> - 2013-03-06 08:31 -0500
Re: sync databse table based on current directory data without losign previous values Lele Gaifax <lele@metapensiero.it> - 2013-03-06 15:16 +0100
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 01:41 -0800
Re: sync databse table based on current directory data without losign previous values Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 00:57 -0800
Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-06 10:11 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-06 02:25 -0800
RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-06 12:31 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Dave Angel <davea@davea.name> - 2013-03-06 08:18 -0500
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Dave Angel <davea@davea.name> - 2013-03-06 08:25 -0500
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-06 02:25 -0800
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-06 23:34 +0000
RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-07 06:33 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Chris Angelico <rosuav@gmail.com> - 2013-03-07 18:19 +1100
RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-08 09:08 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-03-08 19:40 -0500
RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-09 08:07 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Grant Edwards <invalid@invalid.invalid> - 2013-03-09 19:18 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Roy Smith <roy@panix.com> - 2013-03-09 15:04 -0500
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Grant Edwards <invalid@invalid.invalid> - 2013-03-09 20:35 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Roy Smith <roy@panix.com> - 2013-03-09 16:44 -0500
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Grant Edwards <invalid@invalid.invalid> - 2013-03-11 14:27 +0000
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Dave Angel <davea@davea.name> - 2013-03-09 06:02 -0500
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Isaac To <isaac.to@gmail.com> - 2013-03-09 23:02 +0800
Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Terry Reedy <tjreedy@udel.edu> - 2013-03-06 05:59 -0500
Re: sync databse table based on current directory data without losign previous values Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-06 11:52 +0000
RE: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64) Wong Wah Meng-R32813 <r32813@freescale.com> - 2013-03-06 12:36 +0000
Re: sync databse table based on current directory data without losign previous values Chris Angelico <rosuav@gmail.com> - 2013-03-07 00:40 +1100
Re: sync databse table based on current directory data without losign previous values "Michael Ross" <gmx@ross.cx> - 2013-03-06 15:04 +0100
Re: sync databse table based on current directory data without losign previous values nagia.retsina@gmail.com - 2013-03-06 08:09 -0800
Re: sync databse table based on current directory data without losign previous values nagia.retsina@gmail.com - 2013-03-06 08:09 -0800
csiph-web