AWS Lambda Memory Size Calculator
Lambda has no separate memory request and limit — one MemorySize value sets your function's
memory, its proportional vCPU allocation, and its per-millisecond cost all at once. Running out causes a
hard failure rather than graceful throttling, so this calculator sizes memory from peak usage, not
average, and flags anything outside AWS's 128–10240 MB range.
01 Usage data
Where do I get these numbers?
Run this in CloudWatch Logs Insights against the function's log group over a representative period, then export the results as CSV and paste them:
fields @maxMemoryUsed | filter @type = "REPORT"
Each REPORT line is one invocation, and each value the most it used, in bytes. Prometheus output and plain lists of numbers work too.
Enter observed usage directly, in MiB.
02 Workload profile
Advanced: margins and defaults
Values the result relies on that are our own defaults, or vendor defaults your setup may change. Each “?” says how one moves the result; the guide says where it comes from.
03 Sizing gauge
04 Lambda function configuration
—
05 How this was derived
How every number is calculated, with sources and assumptions (opens in a new tab) ↗
Result looks wrong? Report it
MemorySize in short
MemorySize is the memory available to the function at runtime, from 128 MB to 10,240 MB in 1 MB steps. Lambda allocates CPU in proportion to it: at 1,769 MB a function has the equivalent of one vCPU. AWS docs
There is no separate reservation and limit, and running out of memory fails the invocation, so the calculator sizes MemorySize from the peak alone; the average you enter doesn't change the result. The margin is MemoryLimit's own default, not a vendor figure; you can change it under Advanced.
It only answers the memory question: how much the function needs so it doesn't run out. It doesn't measure duration, so it can't tell whether more memory would make a function faster or cheaper. AWS suggests the open-source Lambda Power Tuning tool for that. AWS docs
Common input mistakes
- Pasting figures other than each invocation's maximum (
@maxMemoryUsed): averages hide the peak and give a result that is too small. - A window that misses the busiest invocations:
MemorySizecomes out too low. - Reading the result as the fastest or cheapest size: it is sized for memory use only.
Full derivation, warnings and every assumption: how the AWS Lambda calculator works. The shared formula and margin tables: the sizing model.
Related calculators: