python 内存不能释放
问题
为啥python的gc不能释放内存呢?这个是正常现象吗?
- 我开了一个python的命令行来创建了大概16G的数据
- 我在终端中调用 的del a; gc.collect(); 这16G的内存还存着 不能释放
- 只有exit() 之后才能清理内存
![https://img-mid.csdnimg.cn/release/static/image/mid/ask/807805980876195.png [debug] python 内存不能释放_gc](https://file.cfanz.cn/uploads/png/2023/03/14/0/42PK23c7dd.png)
![https://img-mid.csdnimg.cn/release/static/image/mid/ask/10430398087619.png [debug] python 内存不能释放_内存_02](https://file.cfanz.cn/uploads/png/2023/03/14/0/55I6eI13H6.png)
回答
下面这个方法目测可以:
我怎样才能在Python中明确释放内存? |
![在这里插入图片描述 [debug] python 内存不能释放_gc_03](https://file.cfanz.cn/uploads/png/2023/03/14/0/B4VH02QJ04.png)
[debug] python 内存不能释放
阅读 76
2023-03-14
为啥python的gc不能释放内存呢?这个是正常现象吗?
![https://img-mid.csdnimg.cn/release/static/image/mid/ask/807805980876195.png [debug] python 内存不能释放_gc](https://file.cfanz.cn/uploads/png/2023/03/14/0/42PK23c7dd.png)
![https://img-mid.csdnimg.cn/release/static/image/mid/ask/10430398087619.png [debug] python 内存不能释放_内存_02](https://file.cfanz.cn/uploads/png/2023/03/14/0/55I6eI13H6.png)
下面这个方法目测可以:
我怎样才能在Python中明确释放内存? |
![在这里插入图片描述 [debug] python 内存不能释放_gc_03](https://file.cfanz.cn/uploads/png/2023/03/14/0/B4VH02QJ04.png)
相关推荐
精彩评论(0)