1.问题:Http请求,返回208, 提示设备空间不足
![](https://img.haomeiwen.com/i14458179/79f1e59dcc14dfce.png)
2.原因:起初以为是硬盘空间没了,其实不是。实际上是URLSession太多了
参考Stack Overflow:
It appears to get called when there are too many NSURLSessions created, reaching a limit of (in our tests) 600-700 sessions, which are not maintained or closed properly. The error started to get thrown since iOS 14, so it is interesting to see if there was a limit introduced.
3.解决方法:
因为我的网络请求使用的是AFNetworking库,起初是一个请求创建一个 AFHTTPSessionManager的实例,请求多了,自然就会有多个URLSession。
![截屏2022-04-19 下午9.33.44.png](https://img.haomeiwen.com/i14458179/2139bf17846fa54d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
网友评论