10M memory leave after ShutdownAPI called for 1000 client created
imchenkai opened this issue · 1 comments
imchenkai commented
Describe the bug
We use awsclient in multi threaded environment, The program will continuously generate and destroy awsclient instances。Found that may use alot of memory in this program and never release after showdownAPI called, Is this the expected behavior of awssdk?
Expected Behavior
should release memory after Aws::S3::S3Client deleted,or ShutdownAPI ?
Current Behavior
10M memory leave after ShutdownAPI called for 1000 client created
Reproduction Steps
this is code simple
int main()
{
Aws::SDKOptions options;
Aws::InitAPI(options);
std::thread threads[16];
int i;
for (i = 0; i < 16; i++) {
threads[i] = std::thread([i]() {
int times = 0;
while (times < 100) {
std::cout << "run:" << times++ << std::endl;
Aws::Client::ClientConfiguration config;
config.endpointOverride = "[172.16.0.95:9000](http://172.16.0.95:9000/)";
config.verifySSL = true;
config.scheme = Aws::Http::Scheme::HTTP;
config.requestTimeoutMs = 100;
config.connectTimeoutMs = 100;
Aws::Auth::AWSCredentials cred("minioadmin", "minioadmin");
Aws::S3::S3Client s3_client(cred, config, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
false);
Aws::S3::Model::ListObjectsRequest request;
request.WithBucket("link");
auto outcome = s3_client.ListObjects(request);
if (outcome.IsSuccess())
{
const Aws::Vector<Aws::S3::Model::Object>& objects = outcome.GetResult().GetContents();
if (!objects.empty())
{
const Aws::S3::Model::Object& first_object = objects[0];
Aws::S3::Model::GetObjectRequest get_request;
get_request.WithBucket("link")
.WithKey(first_object.GetKey());
}
}
}
});
}
for (i = 0; i < 16; ++i)
{
threads[i].join();
}
Aws::ShutdownAPI(options);
return 0;
}
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
1.11.323
Compiler and Version used
9.3.1
Operating System and version
centos7
github-actions commented
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.