AWS Developer Forums: Lambda leaking memory with dire ...
I'm using somewhat controversial, albeit absolutely legitimate use case for AWS Lambda functions: recursion. A lambda function, just before termination, is using AWS.Lambda.invokeAsync() to invoke itself. There is some extra code to prevent accidental uncontrolled multiplication of execution threads, there is only one instance running at the time. The problem is that with each invocation the amount of memory used increases. The first invocation is around 15MB, then it's gradually increasing up to the limit specified in settings, in this case 128MB. What happens then is somewhat unpredictable. In most cases some garbage collection (or probably restart of node.js instance) takes place and the next invocation is again below 20MB. Occasionally, the invocations will fail without apparent reason and the recursion will stop. Below is such a sequence of events, additional suspicious behaviour is that GUID of the invocations were the same (5436599f-7975-11e4-aee2-172cf7400691) in the few terminal starts.Read full article from AWS Developer Forums: Lambda leaking memory with dire ...
No comments:
Post a Comment