Path: csiph.com!news.mixmin.net!news.unit0.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Almost crashing computer, was Re: how to solve memory Date: Fri, 10 Jun 2016 16:41:43 +0200 Organization: None Lines: 25 Message-ID: References: <4f853aa2-cc00-480b-9fd7-79b05cbd4889@googlegroups.com> <575ac991$0$1583$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de k3ftvyA/dxGou03hwa/GfQaq8ZrjEzK0c6Np2kPqyqtw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python3': 0.05; '/dev/null': 0.09; 'path)': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'consume': 0.16; 'crashed': 0.16; 'dfs': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'prevent': 0.20; 'machine': 0.21; '(the': 0.22; 'code,': 0.23; '(most': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'linux': 0.26; 'becomes': 0.30; 'computer.': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'traceback': 0.33; 'file': 0.34; 'path': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'skip:u 10': 0.61; 'subject': 0.70 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd9d73.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <4f853aa2-cc00-480b-9fd7-79b05cbd4889@googlegroups.com> <575ac991$0$1583$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:109790 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 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 b.append([str(i)+str(j) for i,j in zip(aaa, bbb)]) MemoryError