Skip to content

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

Open
@yichinzhu

Description

@yichinzhu

版本:>= 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions