Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109790

Almost crashing computer, was Re: how to solve memory

From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Almost crashing computer, was Re: how to solve memory
Date 2016-06-10 16:41 +0200
Organization None
Message-ID <mailman.140.1465569713.2306.python-list@python.org> (permalink)
References <4f853aa2-cc00-480b-9fd7-79b05cbd4889@googlegroups.com> <575ac991$0$1583$c3e8da3$5496439d@news.astraweb.com> <njejj9$k4o$1@ger.gmane.org>

Show all headers | View raw


Steven D'Aprano wrote:

> I just ran your code, and it almost crashed my computer. 

When you suspect that a script may consume a lot of memory (the subject 
might have been a hint)

ulimit (bash internal) 

helps you prevent that your linux machine becomes unresponsive.

$ ulimit -v 200000
$ python3 tmp2.py > /dev/null
Traceback (most recent call last):
  File "tmp2.py", line 134, in <module>
    mresult = DFS(b, 2, 2, mylist, path)
  File "tmp2.py", line 125, in DFS
    path = DFS(b, deep-1, maxx, sourceoperators, path)
  File "tmp2.py", line 129, in DFS
    b.append([str(i)+str(j) for i,j in zip(aaa, bbb)])
  File "tmp2.py", line 129, in <listcomp>
    b.append([str(i)+str(j) for i,j in zip(aaa, bbb)])
MemoryError

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-09 17:58 -0700
  Re: how to solve memory Michael Torrie <torriem@gmail.com> - 2016-06-09 19:12 -0600
    Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-09 21:59 -0700
  Re: how to solve memory Steven D'Aprano <steve@pearwood.info> - 2016-06-11 00:07 +1000
    Almost crashing computer, was Re: how to solve memory Peter Otten <__peter__@web.de> - 2016-06-10 16:41 +0200
    Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 08:00 -0700
    Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 08:23 -0700
    Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 16:23 -0700
  Re: how to solve memory John Gordon <gordon@panix.com> - 2016-06-10 14:46 +0000
    Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 08:08 -0700
      Re: how to solve memory John Gordon <gordon@panix.com> - 2016-06-10 16:26 +0000
        Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 16:31 -0700
          Re: how to solve memory MRAB <python@mrabarnett.plus.com> - 2016-06-11 01:33 +0100
            Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 21:43 -0700
            Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 22:18 -0700
            Re: how to solve memory meInvent bbird <jobmattcon@gmail.com> - 2016-06-10 22:55 -0700

csiph-web