When I ran the code below, the memory was increasing. However if I deleted time.sleep(3)
, it was 0.1
in top
and never increased.
It seems process
not be terminated correctly, but why?
Code(Python 2.7.11
):
import time
import multiprocessing
def process():
#: FIXME
time.sleep(3)
return
def main():
pool = multiprocessing.Pool(processes=10)
while 1:
pool.apply_async(process)
pool.close()
pool.join()
if __name__ == '__main__':
main()