aliyun / aliyun/aliyun-openapi-python-sdk

python 2下aliyun-python-sdk-core存在内存泄漏

Open
#543 0 comments 0 reactions 1 assignee View on GitHub

@CodeSpaceiiii is already working on this.

Since Feb 12, 2025.

Dominant language
Python
Stars
1k
Forks
578
PR merge metrics
No merged PRs in 30d

Description

版本:>= 2.13.33
Python版本: 已验证2.7 存在问题,3.6不存在问题

验证代码

# pip2 install objgraph aliyun-python-sdk-core==2.15.2 aliyun-python-sdk-ecs

from aliyunsdkcore.client import AcsClient
from aliyunsdkecs.request.v20140526.DescribeRegionsRequest import DescribeRegionsRequest
import gc
import objgraph
import traceback

def main():
    client = AcsClient("{ak}", "{sk}", "cn-beijing")
    request = DescribeRegionsRequest()
    request.set_accept_format('json')
    response = client.do_action_with_exception(request)


if __name__ == '__main__':
    cnt = 1
    while True:
        try:
            main()
        except Exception as e:
            traceback.print_exc()
        gc.collect()
        if cnt == 1 or cnt % 100 == 0:
            objgraph.show_growth(limit = 100)
        if cnt % 10 == 0:
            print(cnt)
        cnt += 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.