Re: PC locks up with list operations

2011-09-15 Thread John Nagle
On 8/31/2011 5:40 AM, Chris Withers wrote: On 31/08/2011 13:33, Steven D'Aprano wrote: I am using Linux desktops; both incidents were with Python 2.5. Do newer versions of Python respond to this sort of situation more gracefully? Ironically, Windows does better here and dumps you out with a Me

Re: PC locks up with list operations

2011-09-13 Thread Carl Banks
On Wednesday, August 31, 2011 5:49:24 AM UTC-7, Benjamin Kaplan wrote: > 32-bit or 64-bit Python? A 32-bit program will crash once memory hits > 2GB. A 64-bit program will just keep consuming RAM until your computer > starts thrashing. The problem isn't your program using more RAM than > you have,

Re: PC locks up with list operations

2011-09-12 Thread Terry Reedy
On 9/12/2011 7:40 AM, Roy Smith wrote: In article<4e6dc66e$0$29986$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: mylist = [0]*12345678901234 [...] Apart from "Then don't do that!", is there anything I can do to prevent this sort of thing in the future? Like instruct Python no

Re: PC locks up with list operations

2011-09-12 Thread Nobody
On Wed, 31 Aug 2011 22:47:59 +1000, Steven D'Aprano wrote: >> Linux seems to fair badly when programs use more memory than physically >> available. Perhaps there's some per-process thing that can be used to >> limit things on Linux? > > As far as I know, ulimit ("user limit") won't help. It can l

Re: PC locks up with list operations

2011-09-12 Thread Roy Smith
In article <4e6dc66e$0$29986$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > > mylist = [0]*12345678901234 > [...] > > Apart from "Then don't do that!", is there anything I can do to prevent > > this sort of thing in the future? Like instruct Python not to request more > > memory t

Re: PC locks up with list operations

2011-09-12 Thread Steven D'Aprano
On Wed, 31 Aug 2011 10:33 pm Steven D'Aprano wrote: > Twice in a couple of weeks, I have locked up my PC by running a Python 2.5 > script that tries to create a list that is insanely too big. > > In the first case, I (stupidly) did something like: > > mylist = [0]*12345678901234 [...] > Apart fr

Re: PC locks up with list operations

2011-08-31 Thread Tim Chase
On 08/31/11 18:31, Gregory Ewing wrote: The Python process should also be able to set its own limits using resource.setrlimit(). A new corner of stdlib that I've never poked at. Thanks for the suggestion. Disappointed though that it doesn't seem to have docstrings on the functions, so I had

Re: PC locks up with list operations

2011-08-31 Thread Gregory Ewing
Steven D'Aprano wrote: As far as I know, ulimit ("user limit") won't help. It can limit the amount of RAM available to a process, but that just makes the process start using virtual memory more quickly. ulimit -v is supposed to set the maximum amount of virtual memory the process can use. It

Re: PC locks up with list operations

2011-08-31 Thread Rodrick Brown
$ man limits.conf Sent from my iPhone On Aug 31, 2011, at 8:33 AM, Steven D'Aprano wrote: > Twice in a couple of weeks, I have locked up my PC by running a Python 2.5 > script that tries to create a list that is insanely too big. > > In the first case, I (stupidly) did something like: > > m

Re: PC locks up with list operations

2011-08-31 Thread Robert Spanjaard
On 08/31/2011 02:40 PM, Chris Withers wrote: On 31/08/2011 13:33, Steven D'Aprano wrote: I am using Linux desktops; both incidents were with Python 2.5. Do newer versions of Python respond to this sort of situation more gracefully? Ironically, Windows does better here and dumps you out with a

Re: PC locks up with list operations

2011-08-31 Thread Peter Otten
Steven D'Aprano wrote: > Twice in a couple of weeks, I have locked up my PC by running a Python 2.5 > script that tries to create a list that is insanely too big. > > In the first case, I (stupidly) did something like: > > mylist = [0]*12345678901234 > > After leaving the machine for THREE DAYS

Re: PC locks up with list operations

2011-08-31 Thread Benjamin Kaplan
On Wed, Aug 31, 2011 at 8:40 AM, Chris Withers wrote: > > On 31/08/2011 13:33, Steven D'Aprano wrote: >> >> I am using Linux desktops; both incidents were with Python 2.5. Do newer >> versions of Python respond to this sort of situation more gracefully? > > Ironically, Windows does better here and

Re: PC locks up with list operations

2011-08-31 Thread Steven D'Aprano
Chris Withers wrote: > On 31/08/2011 13:33, Steven D'Aprano wrote: >> I am using Linux desktops; both incidents were with Python 2.5. Do newer >> versions of Python respond to this sort of situation more gracefully? > > Ironically, Windows does better here and dumps you out with a > MemoryError b

Re: PC locks up with list operations

2011-08-31 Thread Chris Withers
On 31/08/2011 13:33, Steven D'Aprano wrote: I am using Linux desktops; both incidents were with Python 2.5. Do newer versions of Python respond to this sort of situation more gracefully? Ironically, Windows does better here and dumps you out with a MemoryError before slowly recovering. Linux

PC locks up with list operations

2011-08-31 Thread Steven D'Aprano
Twice in a couple of weeks, I have locked up my PC by running a Python 2.5 script that tries to create a list that is insanely too big. In the first case, I (stupidly) did something like: mylist = [0]*12345678901234 After leaving the machine for THREE DAYS (!!!) I eventually was able to get to a