Python Subprocess: Too Many Open Files -


i using subprocess call program , save return values variable. process repeated in loop, , after few thousands times program crashed following error:

traceback (most recent call last):   file "./extract_pcgls.py", line 96, in <module>     selfe.append( calselfenergy(i) )   file "./extract_pcgls.py", line 59, in calselfenergy     p = subprocess.popen(cmd, stdout=subprocess.pipe, shell=true)   file "/usr/lib/python3.2/subprocess.py", line 745, in __init__     restore_signals, start_new_session)   file "/usr/lib/python3.2/subprocess.py", line 1166, in _execute_child     errpipe_read, errpipe_write = _create_pipe() oserror: [errno 24] many open files 

any idea how solve issue appreciated!

code supplied comments:

cmd = "enercharmm.pl -parram=x,xtop=topology_modified.rtf,xpar=lipid27_modified.par,nobuildall -out vdwaals {0}".format(cmtup[1]) p = subprocess.popen(cmd, stdout=subprocess.pipe, shell=true) out, err = p.communicate() 

in mac osx (el capitan)

#ulimit -a core file size          (blocks, -c) 0 data seg size           (kbytes, -d) unlimited file size               (blocks, -f) unlimited max locked memory       (kbytes, -l) unlimited max memory size         (kbytes, -m) unlimited open files                      (-n) 256 pipe size            (512 bytes, -p) 1 stack size              (kbytes, -s) 8192 cpu time               (seconds, -t) unlimited max user processes              (-u) 709 virtual memory          (kbytes, -v) unlimited 

use set value 10k :

#ulimit -sn 10000 

verify results:

#ulimit -a  core file size          (blocks, -c) 0 data seg size           (kbytes, -d) unlimited file size               (blocks, -f) unlimited max locked memory       (kbytes, -l) unlimited max memory size         (kbytes, -m) unlimited open files                      (-n) 10000 pipe size            (512 bytes, -p) 1 stack size              (kbytes, -s) 8192 cpu time               (seconds, -t) unlimited max user processes              (-u) 709 virtual memory          (kbytes, -v) unlimited 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -