python3 urllib 内存泄露_python3.6.6的requests库发https请求,会内存泄漏,win10,ubuntu16.04都会...

python3.6.6的requests库发https请求,会内存泄漏win10,ubuntu16.04都会

stackoverflow,github上都问了,没人回,之前3.6.1的时候,Python官方版也有这个问题,现在已经修复了

但我还会遇上

代码如下:

import requests

while 1:

with requests.get('https://www.baidu.com') as r:

text = r.text

各个库版本如下:

{

"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调试,没找到原因,求教!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值