Quarkus Lambda Native Image Memory Leakage #24516
apurvar1010
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have created an amazon lambda using Quarkus framework and packaged it using GraalVM native-image. The functionalities is quite simple with basic validations, however I am creating Dynamo DB client and SQS clients. I have instantiated those clients outside of Quarkus Request Handler and using Http Client Connection while building the clients as mentioned in this guide: https://quarkus.io/guides/amazon-lambda#aws-sdk-v2
In the AWS console, I have set the max memory as 256 mb (This is the requirement). The first invocation takes about 1000ms and uses 74 mb. However for each consecutive invocation of lambda, the memory consumption keeps on increasing and it instantiates all the clients (Dynamo DB and SQS) again and again. Is there a way to keep the memory consumed lower and instantiating these clients once in a while as and when required?
The Lambda handler code is as follows:
One of the example of initiating the client is this:
For each of the lambda invocation, the clients are getting initiated and I was wondering if there is a way to limit it to one in let's say 100 requests.
If not, is there any other way to overcome memory leakage.
Beta Was this translation helpful? Give feedback.
All reactions