# CloudWatch alarm: Lambda Insights memory_utilization

CloudWatch alarms · Updated 16 November 2026

**Short answer:** Alarm on LambdaInsights memory_utilization per function_name using the Average over 60 seconds, firing when it is above 90 for 10 of 10 minutes. It warns you that a function has been using more than 90% of its configured memory for ten minutes, before invocations start failing because they run out.

## What the metric measures

`memory_utilization` is the memory a function used during an invocation, as a percentage of the memory you configured for it. The standard `AWS/Lambda` namespace has no memory metric at all; this one comes from **Lambda Insights** and lands in the `LambdaInsights` namespace. To get it, a function needs two things:

- the Lambda Insights extension added as a layer (the ARN is specific to your Region and architecture; take it from the Lambda Insights documentation);
- the `CloudWatchLambdaInsightsExecutionRolePolicy` managed policy, or equivalent permissions, on the function's execution role.

Lambda Insights adds CloudWatch metric and log charges for each function you enable it on, so turn it on for the functions where memory matters rather than everywhere.

Without Lambda Insights you can still see peak memory per invocation in the `Max Memory Used` field of each `REPORT` log line; [this Logs Insights query](https://cloudconsole.dev/logs-insights/lambda-memory-usage) summarises it. That is fine for investigation but awkward to alarm on.

## Recommended alarm settings

| Setting | Recommended value |
|---|---|
| Namespace | `LambdaInsights` |
| Metric | `memory_utilization` |
| Dimensions | function_name |
| Statistic | Average |
| Threshold | 90 |
| Period | 60 seconds |
| Datapoints to alarm | 10 |
| Evaluation periods | 10 |
| Comparison operator | `GreaterThanThreshold` |

## Why 90%, and when to go lower

When an invocation needs more memory than the function has, Lambda stops it and the invocation fails, often with [signal: killed](https://cloudconsole.dev/errors/lambda-out-of-memory) in the logs. Alerting at an average of 90% across ten minutes tells you the function is living close to that edge, not just that one invocation was heavy.

The average hides outliers, which matters for functions whose input size varies. Use the history to decide:

1. Chart `memory_utilization` for the function over two weeks, with both Average and Maximum.
2. If the Maximum regularly sits much higher than the Average (a 40 MB file one minute, a 400 MB file the next), lower the threshold to something like 75 or 80, so the alarm fires while the largest inputs still fit.
3. If the line is flat and well below 90, keep 90. The ten-minute window already ignores a brief burst.

## Create the alarm

```
aws cloudwatch put-metric-alarm \
  --alarm-name lambda-image-resizer-memory-high \
  --alarm-description "image-resizer averaging over 90% of its memory for 10 minutes" \
  --namespace LambdaInsights \
  --metric-name memory_utilization \
  --dimensions Name=function_name,Value=image-resizer \
  --statistic Average \
  --period 60 \
  --evaluation-periods 10 \
  --datapoints-to-alarm 10 \
  --threshold 90 \
  --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:eu-west-2:123456789012:oncall-alerts
```

Note the lower-case `function_name` dimension: Lambda Insights does not use the `FunctionName` spelling of `AWS/Lambda`, and an alarm with the wrong case never receives data.

## When it fires

1. **Check for failures already happening.** Look at the function's [Errors](https://cloudconsole.dev/alarms/lambda-errors) and search the log group for `Runtime.ExitError` or `signal: killed` in the same window.

2. **Decide between growth and a leak.** If usage rises over the life of each execution environment and falls after a cold start, something is kept in memory between invocations: a module-level cache, a list that is appended to, clients created per request and never closed.

3. **Give it room now.** Raising memory is quick and also raises the CPU share:

   ```
   aws lambda update-function-configuration \
     --function-name image-resizer \
     --memory-size 1024
   ```

   Measure the cost and duration effect of different sizes; profiling tools built for Lambda can try several settings for you.

4. **Then fix the cause:** stream large objects instead of loading them whole, bound in-memory caches, and pool database connections (RDS Proxy is the usual route for relational databases) instead of opening new ones in every invocation.

## Questions

### How do I monitor Lambda memory usage in CloudWatch?

Enable Lambda Insights on the function to get memory_utilization and related metrics in the LambdaInsights namespace. Without it, read Max Memory Used from the REPORT lines in the function's logs.

### Does increasing Lambda memory cost more?

The price per millisecond rises with memory, but more memory also gives more CPU, so many functions finish faster. Measure duration at a couple of sizes before deciding.

### Why is memory_utilization missing for my function?

The Lambda Insights layer is not attached, the execution role lacks permission to write its data, or the function has not been invoked since you enabled it.

## When this happens away from your desk

Memory alarms on Lambda usually mean a quick memory bump now and a code fix later. CloudConsole, a phone app for AWS, is built to show the alarm and the function's recent invocations on your phone with production guardrails.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Recommended alarms (Amazon CloudWatch User Guide)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html)
- [Configure Lambda function memory](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html)
- [Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/)

## Related

- [Runtime exited with error: signal: killed (Lambda out of memory)](https://cloudconsole.dev/errors/lambda-out-of-memory)
- [Lambda memory usage with Logs Insights](https://cloudconsole.dev/logs-insights/lambda-memory-usage)
- [CloudWatch alarm: Lambda Duration (p90)](https://cloudconsole.dev/alarms/lambda-duration)
- [CloudWatch alarm: Lambda Errors](https://cloudconsole.dev/alarms/lambda-errors)
- [aws lambda update-function-configuration](https://cloudconsole.dev/cli/lambda-update-function-configuration)
- [CloudWatch alarm: Lambda ClaimedAccountConcurrency](https://cloudconsole.dev/alarms/lambda-claimedaccountconcurrency)

---

Source: https://cloudconsole.dev/alarms/lambda-insights-memory-utilization

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
