1 Answer
- Newest
- Most votes
- Most comments
2
Hello.
I don't think AWS officially announced the Lambda initialization timing.
My impression is that if you wait about 5 minutes and then re-run Lambda, it will run in an initialized environment.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html
I think it depends on the error and processing details, but I think it's a good idea to do something similar to initialization by freeing up memory or deleting the "/tmp" folder when Lambda processing ends.
For example, in Python, you can free up memory by releasing variables using "del".
https://docs.python.org/3/tutorial/datastructures.html#the-del-statement
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 4 years ago
