The code runs smoothly for quite some time, then suddenly it gives OSError: [Errno 12] Cannot allocate memory
def initialize(site):
global pool
if site == 'OT':
for jobId in JobIdsOT:
argumentList = [jobId, site]
pool.map(assignTask, [argumentList])
elif site == 'LI':
for jobId in JobIdsLI:
argumentList = [jobId, site]
pool.map(assignTask, [argumentList])
StackTrace:
Traceback (most recent call last):
File "LogDumper.py", line 301, in <module>
main()
File "LogDumper.py", line 58, in main
initialize('OT')
File "LogDumper.py", line 78, in initialize
pool.map(assignTask, [argumentList])
File "/usr/lib64/python2.6/multiprocessing/pool.py", line 148, in map
return self.map_async(func, iterable, chunksize).get()
File "/usr/lib64/python2.6/multiprocessing/pool.py", line 422, in get
raise self._value
OSError: [Errno 12] Cannot allocate memory
I referred this question Python cannot allocate memory using multiprocessing.pool . But I am not sure about the solution.
How can I resolve the aforementioned issue?