Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(short issue description)leak memory #3196

Open
1 task
zymerry opened this issue Nov 15, 2024 · 5 comments
Open
1 task

(short issue description)leak memory #3196

zymerry opened this issue Nov 15, 2024 · 5 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@zymerry
Copy link

zymerry commented Nov 15, 2024

Describe the bug

Aws::Client::ClientConfiguration clientConfig;
            if (!region.empty())
                clientConfig.region = region;
            clientConfig.endpointOverride = endpoint;
            // 30 s
            clientConfig.requestTimeoutMs = 30000;
            clientConfig.connectTimeoutMs = 10000;

            LOG_DEBUG("Aws region: %s, ak: %s, sk: %s, object_name: %s endpoint: %s bucket:%s", region.c_str(), ak.c_str(), sk.c_str(), key.c_str(), endpoint.c_str(), bucket_name.c_str());
            Aws::S3::S3Client s3_client(Aws::Auth::AWSCredentials(ak,sk), clientConfig);

            Aws::S3::Model::PutObjectRequest object_request;
            object_request.WithBucket(bucket_name).WithKey(key_name);

            object_request.SetBody(request_body);

            auto put_object_outcome = s3_client.PutObject(object_request);

以上是我的调用代码,我会在产生云存的线程里一直调用上边的代码。当流入的带宽有增加的情况下,程序占用的内存会有明显增长。但是在带宽下降后,增长的内存并没有得到释放。

说明:
我的程序是持续运行的,在程序开头调用了 Aws::InitAPI(_options);

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

在带宽下降的情况下,占用的内存能够释放掉。

Current Behavior

程序内存会持续性的增加

Reproduction Steps

leak memory

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.7

Compiler and Version used

6.1

Operating System and version

centos7

@zymerry zymerry added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2024
@zymerry
Copy link
Author

zymerry commented Nov 15, 2024

这个Aws::S3::S3Client s3_client(Aws::Auth::AWSCredentials(ak,sk), clientConfig);可能同样一个配置的,我需要同时创建多个来用来上传文件,涉及到业务问题,所以不能使用一个上传。

@zymerry
Copy link
Author

zymerry commented Nov 15, 2024

在上行带宽增加时,程序内存的占用率增加,在带宽下降时,程序内存使用率持续平衡。等到下次带宽开始增加时,程序内存的占用率又开始增加。周而复始,直至内存耗尽。

@jmklix
Copy link
Member

jmklix commented Nov 15, 2024

Sorry, I don't understand Chinese, but I will do my best with google translate.

Can you make sure that you are making all sdk calls following the correctly format by using {}

#include <aws/core/Aws.h>
int main(int argc, char** argv)
{
   Aws::SDKOptions options;
   Aws::InitAPI(options);
   {
      // make your SDK calls here.
   }
   Aws::ShutdownAPI(options);
   return 0;
}

Also can you update to a newer version of this sdk. 1.7 is very old and there have been many fixes since then.

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2024
@jmklix jmklix self-assigned this Nov 15, 2024
@zymerry
Copy link
Author

zymerry commented Nov 22, 2024

I use the https protocol to send the data to the endpoint. There is a memory leak problem in multithreaded scenarios.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Nov 23, 2024
@jmklix
Copy link
Member

jmklix commented Nov 26, 2024

Can you provide more details of the memory leak?

I'll mention this again, but upgrading to a newer version of the sdk would be helpful. 1.7 if very old

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants