views:

36

answers:

1

I use

check_call('convert ...', shell=True)

to open the process. This is run inside apache. I start getting this exception after a few days:

 File "/usr/lib/python2.6/subprocess.py", line 457, in check_call
    retcode = call(*popenargs, **kwargs)

  File "/usr/lib/python2.6/subprocess.py", line 444, in call
    return Popen(*popenargs, **kwargs).wait()

  File "/usr/lib/python2.6/subprocess.py", line 595, in __init__
    errread, errwrite)

  File "/usr/lib/python2.6/subprocess.py", line 1009, in _execute_child
    self.pid = os.fork()

OSError: [Errno 12] Cannot allocate memory

I researched a little and this is what I found. Apparently, I am running out of file descriptors. However, I don't see where they get leaked. Does anyone have a hint how I can fix this?

Thanks

+1  A: 

@SilentGhost: Because of this: http://bramp.net/blog/python-close_fds-issue.

Marko