question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Max Memory Used Incorrect

See original GitHub issue

Description:

When using the python 3.8 lambda runtime the ‘Max Memory Used’ always shows the same number as the total memory allocated.

Steps to reproduce:

Running any python 3.8 lambda w/ v 1.13.2

Observed result:

Max Memory Used always = Memory Allocated

Expected result:

Expected result is the actual memory usage of the Lambda

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Linux Centos 7
  2. sam --version: 1.13.2

Other versions: awscli: 1.18.189 botocore: 1.19.14 boto3: 1.13.19

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tazsinghcommented, Jan 5, 2021

@jfuss For the original issue, would it be possible to omit that false “Max Memory Used” entirely if it’s not possible to make it accurate? At least then it wouldn’t be misleading

For my comment, ah ok, I was unaware that AWS Lambda itself didn’t provide an OOM error. Thanks for the tip about the various behaviours 👍 Some sort of improvement would certainly be appreciated and I’ll inform you if something does come to mind

1reaction
tazsinghcommented, Jan 2, 2021

the issue is “fixed” by downgrading to 1.12.0

And unfortunately losing all the features in subsequent releases 😅 I’m really enjoying the official Warm Containers feature from 1.14!


I was bit by this quite badly recently, not strictly because the Memory Usage is the same as the Memory Size, but because there is no error telling me there is an Out Of Memory error when it actually happened. The Lambda just fails once the memory limit is hit, with the following output:

END RequestId: 45832c6d-7be9-49f6-a7d0-f4540affad04
REPORT RequestId: 45832c6d-7be9-49f6-a7d0-f4540affad04        Duration: 1731.93 ms    Billed Duration: 1800 ms      Memory Size: 256 MB  Max Memory Used: 256 MB
Invalid lambda response received: Lambda response must be valid json
2021-01-02 13:17:40 127.0.0.1 - - [02/Jan/2021 13:17:40] "GET / HTTP/1.1" 502 -

Note: I’m not even getting the opportunity to respond, the process just quits as soon as the memory limit is reached. So that ‘invalid JSON response’ message had me chasing the wrong goose.

Given the limitation to display the memory usage, would it be possible to notify me that an OOM error has occurred such that I can debug accordingly?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The usable memory may be less than the installed ...
Describes a problem in which Windows 7 reports that the usable memory is less than the installed memory.
Read more >
Memory Dangerously Low or Max Memory Too High
1) Decide what to set your max server memory (MB) to. Our simple “starter” rule of thumb is to leave 4GB or 10%...
Read more >
AWS Lambda function increasing Max Memory Used
It keeps increasing after some executions, it goes from 217MB to 218MB, after to 219MB and so on. This function is running multiple...
Read more >
Unable to Start SQL Server Service or Connect After ...
Verify that the server has adequate memory. Use sp_configure with option 'user connections' to check the maximum number of user connections ...
Read more >
Incorrect Memory Used values with a '#' sign or as '#1' for ...
sp_configure shows incorrect 'Memory Used' values with a '#' sign or as '#1' for ... For example: 1> sp_configure 'max memory', 0, '2048G'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found