- Newest
- Most votes
- Most comments
Hello, you can have a look at these references: https://towardsdatascience.com/optimize-aws-lambda-memory-more-memory-doesnt-mean-more-costs-51ba566fecc7 https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html
As the posts mentioned, "increases the amount of CPU, increasing the overall computational power available. If a function is CPU-, network- or memory-bound, then changing the memory setting can dramatically improve its performance." And the Max Memory Used is depended on your code and it's not configured in Lambda. So you could fine tune the code if you want to improve the computation time.
The more memory you give your function, the more CPU you get. At ~1760MB, you get a full core. If you function is CPU bound, this will help it run faster, and therefor cost less.
Memory used depends on your application. There is no need to consume more memory of you do not need it. If your code can run faster by utilizing more memory, e.g., using memoization, please do so. You can also create multiple threads, which will probably consume more memory, and can potentially reduce the duration.
Relevant content
- asked 2 years ago
- asked 6 months ago
- AWS OFFICIALUpdated a year ago

Thanks for your answer. As I explained in the question, I have tried many memory settings and 1500ms gives me the lowest cost=time*memory. Given my situation what is the best strategy to increase memory usage in Python?
You're welcome. As I mentioned, it depends on your code and what your function is going to do. If you would like to improve the computation time, the direction should not be only to increase memory usage. You may need to use another algorithm or data structure to improve the performance. So it falls into the performance tuning for python code.