'How to reset memory usage after Azure Function runs
I've implemented memory profiling into my Azure Function, received a python 137 error, went to check the memory usage and found that the memory usage will slowly increase. Most of the time it will reset, but sometimes it doesn't and I'm assuming it's hitting the RAM cap on the function.
Here is the highest the memory usage got before throwing that 137 error:

Is this enough to warrant a 137 error? If so, is there a way I can reset the memory usage after each invocation manually?
Solution 1:[1]
One of the workaround is to delete the temp files.
Unlike Persisted files, these files are not shared among site instances. Also, you cannot rely on them staying there. For instance, if you restart a web app, you'll find that all of these folders get reset to their original state.
So, you can just restart your function app in order to reset memory usage.
From portal:

Result:

REFERENCES: Understanding the Azure App Service file system
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
