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

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

Open
yichinzhu opened this issue Feb 12, 2025 · 0 comments
Open

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

yichinzhu opened this issue Feb 12, 2025 · 0 comments
Assignees

Comments

@yichinzhu
Copy link

yichinzhu commented Feb 12, 2025

版本:>= 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
@CodeSpaceiiii CodeSpaceiiii self-assigned this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants