MemoryError: memory allocation failed, allocating 1348 bytes



  • Dear Community,

    I think I ran into this issue after carrying out extensive computation by establishing bidirectional communication between the lopy nodes. I copied the code to the SD card, but don't understand how the computation would occur externally.

    Any suggestion on how to rectify this?

    Note: When I mean computation I am just using the API call to get the SNR within the infinite while loop and receive data from the transmitter and creating lists to store what needs to be sent back to the transmitter. (I even tried reducing the number of lists used for solving this issue.

    Any feedback will be really helpful. ( I am using LoPy 3)



  • @crumble Hi thank you so much for your input. By details would posting my code help narrow down on what is happening?



  • @snehasg96

    without details we can only tell you to reduce your memory allocations ;)

    Check if you really need that much RAM or if you have a memory leak. If you really need that much, store the huge data on SD card. Call GC before allocating huge chunks. Avoid stuff which fragments your RAM. Avoid floats, with statments for locks, string methods and such stuff.


Log in to reply
 

Pycom on Twitter