Python中的内存泄漏 [英] Memory leak in Python

查看:128
本文介绍了Python中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在庞大数据集上的python代码。

启动程序后,计算机变得不稳定,并且甚至打开konsole以杀死该进程。我假设

是我的内存不足。


我应该做些什么来确保我的代码运行良好而不会变成

不稳定。如果有的话,我应该如何解决内存泄漏问题?我有
a gig of RAM。


感谢所有帮助。

I have a python code which is running on a huge data set. After
starting the program the computer becomes unstable and gets very
diffucult to even open konsole to kill that process. What I am assuming
is that I am running out of memory.

What should I do to make sure that my code runs fine without becoming
unstable. How should I address the memory leak problem if any ? I have
a gig of RAM.

Every help is appreciated.

推荐答案

你能粘贴你正在使用的代码的例子吗?

Can you paste an example of the code you''re using?


集合有多大? 100MB,更多?你在做什么?你有一个小例子可以证明这个装置会导致冻结吗?

我不是棚子里最锋利的工具但听起来你可能是/>
永久或暂时将您的设置乘以/ b
目的或意外。

how big is the set? 100MB, more? what are you doing with the set? do
you have a small example that can prove the set is causing the freeze?
I am not the sharpest tool in the shed but it sounds like you might be
multiplying your set in/directly either permanently or temporarily on
purpose or accident.


其有点65行代码......不是粘贴代码的最佳选择。
co ******* *@gmail.com 写道:
Its kinda 65o lines of code...not the best idea to paste the code.
co********@gmail.com wrote:
你能粘贴一个你正在使用的代码的例子吗?
Can you paste an example of the code you''re using?






这篇关于Python中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆