Replies: 3 comments 3 replies
-
@CarlosIS2 Can you try setting the max heap size environment variable for the function described in this blog post? I doubt in your case it will make difference but it would be good to rule that out. https://aws.amazon.com/blogs/developer/configuring-net-garbage-collection-for-amazon-ecs-and-aws-lambda/ The reason I doubt it will make a difference is Lambda report the memory usage is still much less then the max memory. That implies in that approx 1500th iteration something in the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks to everyone for the help, Apologies to everyone for the confussion, its not really aws lambda related error, although the memory log from cloudwatch didnt really help that much. I leave this link about sql connection pooling on ado.net from microsoft docs for everyone insterested down below. https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-connection-pooling |
Beta Was this translation helpful? Give feedback.
-
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:
By knowing the list that comes as parameter, with that logger at line 5 I can see that the error happens at iteration number 1500 aprox (out of 1700 items).
Here are some logs from cloudwatch that illustrate the issue:
As the error suggest, it seems like a memory issue but the max memory usage does not surpass the lambda memory size. As stated before, I have tried max memory configuration and timeout (15 minutes).
Moreover, the lambda runs like a charm on local machine (Windows 10) through mock lambda test tool.
Any help would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions