Skip to content

Function running out of memory #1519

Answered by CarlosIS2
CarlosIS2 asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings, I am running an aws lambda (dotnet6 runtime) that gathers information from several databases, serializes it, and exports it to an S3 bucket.

Despite changing memory configuration (up to 10240 MB), cloudwatch logs still report Out of Memory. The code in question contains a method that runs a loop of sql connections in using blocks, and I have realized that this error shows up after 1500 iterations approximately. Even if I skip code ran before this method, the error still happens at the same iteration.

Here is the relevant code:

public async Task FunctionHandler(ILambdaContext context)
{
    context.Logger.LogInformation($"Date: {DateTime.UtcNow:dd/MM/yyyy HH:mm}");
    try
    …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@CarlosIS2
Comment options

@CarlosIS2
Comment options

@ashishdhingra
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by CarlosIS2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants