What version are you running?
1.6RC2
We often have a high memory consumption on our reviewboard server, and when it happens, there are some 'patch' processes blocked.
I looked at how you launch the 'patch' utility, and I think that there is a potential pb, due to the use of Popen.wait() with pipes. According to the documentation (http://docs.python.org/library/subprocess.html#popen-objects), there is a potential deadlock if the date sent to the pipe is larger than the pipe buffer size (we have some very huge diffs).
Here is a small python code to reproduce it:
--------------------------------------
import sys, subprocess
def main():
data = ""
for i in range(100000):
data += "%d\n" % i
p = subprocess.Popen(['cat'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
p.stdin.write(data)
p.stdin.close()
output = p.stdout.read()
failure = p.wait()
if failure:
print("error")
sys.exit(1)
sys.stdout.write(output)
if __name__ == '__main__': main()
-----------------------------------------------------------
As long as 'data' is small enough (i.e. with a small maximum value of 'i'), everything works well. But with 'i' ranging from 0 to 100000, p.wait() blocks.
The documentation recommends to use Popen.communicate()