Quarkus Lambda 内存泄漏
我使用 Quarkus 框架创建了一个 amazon lambda,并使用 GraalVM 本机映像将其打包。功能非常简单,具有基本验证,但我正在创建 Dynamo DB 客户端和 SQS 客户端。 我已在 Quarkus 请求处理程序之外实例化了这些客户端,并在构建客户端时使用 Http 客户端连接,如本指南中所述: https://quarkus.io/guides/amazon-lambda#aws-sdk-v2
在AWS控制台中,我将最大内存设置为256 mb(这是要求)。第一次调用大约需要 1000 毫秒并使用 74 MB。然而,对于 lambda 的每次连续调用,内存消耗不断增加,并且它会一次又一次地实例化所有客户端(Dynamo DB 和 SQS)。有没有一种方法可以降低内存消耗并在需要时偶尔实例化这些客户端?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论