作者:1056fgv | 来源:互联网 | 2023-07-02 11:37
python3.6.6的requests库发https请求,会内存泄漏win10,ubuntu16.04都会
stackoverflow,github上都问了,没人回,之前3.6.1的时候,Python官方版也有这个问题,现在已经修复了
但我还会遇上
代码如下:
1 2 3 4
| import requests
while 1:
with requests.get('https://www.baidu.com') as r:
text = r.text |
各个库版本如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| {
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3.1"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010009f",
"version": "18.0.0"
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": true
} |
win10下用任务管理器,ubuntu下用top -p都能看到内存持续增长
用过gc,objgraph调试,没找到原因,求教!!!