Skip to content

Commit

Permalink
fix a 'too many files open' error when running with many iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
mackstann committed Mar 23, 2010
1 parent 5266939 commit 709ae56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@

ps_proc = subprocess.Popen(['ps up %d | tail -n1' % proc.pid], shell=True, stdout=subprocess.PIPE)
nbytes = int(ps_proc.stdout.read().split()[4]) * 1024
ps_proc.wait()

os.kill(proc.pid, signal.SIGTERM)
proc.wait()

if nbytes: # otherwise it crashed
line = ','.join(map(str, [benchtype, nkeys, program, nbytes, after-before]))
Expand Down

0 comments on commit 709ae56

Please sign in to comment.