On Google Cloud Run, I have a Python script that requires a small amount of memory. According to tracemalloc
the peak memory is of the order of 20 Mb.
Yet, about 1 of 4 runs fails:
"Memory limit of 512 MiB exceeded with 516 MiB used."
Furthermore, in the "Cloud Run Metrics" it says that "Container memory utilization" of all runs is higher than 70%.
What could be the reason? Could this be explained by any memory overhead of Google Cloud Run? If yes, what is the order of magnitude of this memory overhead? What can I do to reduce the memory usage? Any other suggestions or solutions?
Thanks in advance!