0

enter image description here

Exception has occurred: MemoryError Unable to allocate 34.6 MiB for an array with shape (2265257,) and data type complex128

enter image description here

Hello, I have encountered this error. But I can't understand why this kind of error occurs.

I know that It is raised due to lack of memory.

But I have enough memory to handle that data.

Do you know why Python limits it even when I have more memory?

Antonio SEO
  • 247
  • 5
  • 19

1 Answers1

1

It looks like you are using the 32 bit version of python. On Microsoft Windows, 32 bit processes can only utilize 2 GB of 4 GB maximum possible memory and your Python process is near the limit. I suggest using the 64 bit version.

flandersen
  • 322
  • 2
  • 8
  • Thank you so much for your answer. Is there any way to unlimit that? – Antonio SEO May 09 '20 at 16:05
  • I have to use this cuz of one middleware – Antonio SEO May 09 '20 at 16:05
  • Unfortunately you cannot overcome the architectural limit. But maybe you can analyze and optimize your code in terms of memory consumption. In this thread you can find some tips: https://stackoverflow.com/questions/11002247/how-to-reduce-python-script-memory-usage Maybe you can give the Python memory-profiler a try. https://pypi.org/project/memory-profiler/ – flandersen May 09 '20 at 17:38