7

I have a Python program that runs in several processes, and I periodically get the following error message that I can't resolve...or even really tie down to a specific section of code. Any suggestions on the cause, or a way to trap for this error and continue around it?

 File "/usr/lib/python3.4/multiprocessing/queues.py", line 242, in _feed
    obj = ForkingPickler.dumps(obj)
  File "/usr/lib/python3.4/multiprocessing/reduction.py", line 50, in dumps
    cls(buf, protocol).dump(obj)
MemoryError

I am running Python 3.4.2

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • It means you are running out of memory. It is unclear why without looking at your code- but your dump method is using up too much memory. https://docs.python.org/3/library/exceptions.html – chevybow Apr 18 '18 at 21:06
  • Hi @user3813960, as first thing you can try to profile the memory usage, take a look [here](https://stackoverflow.com/questions/552744/how-do-i-profile-memory-usage-in-python). Add some code to your question, maybe the task that you think is more expansive, also post the output of the memory profiling. With some extra details we can help you better understand where the problem is, also share your OS info. Thanks. – Carlo Zanocco Aug 29 '20 at 12:44

0 Answers0