2005年06月14日 星期二 13:11
Jason Liu,你好 请教一下“引用数到0”是什么意思? Qutr , qutianrang at gmail.com 2005-6-14 ----- 收到以下来信内容 ----- 发件人: Jason Liu 收件人: qutianrang,python-chinese 时 间: 2005-06-14, 13:09:04 主 题: Re: [python-chinese] 也问一个关于内存的问题 不一定,看引用数到没到0 在 05-6-14,Qutr<qutianrang at gmail.com> 写道: > python-chinese : > > 大家好! > > 如果我有一个字典 > a = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e",.............} > 把该字典中的内容常驻内存, > 当用 del a[1] 后内存占用会不会降低? > > > > > Qutr, qutianrang at gmail.com > 2005-6-14 > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050614/56606519/attachment.html
2005年06月14日 星期二 13:47
python中的内存是自动回收,每一个对象都有一个计数器表示有多少个对它的引用,一旦为0表示无人使用,当python在执行垃圾回收时会把这个对象自动释放掉。这个过程一般是不可控的,和java一样。 在 05-6-14,Qutr<qutianrang at gmail.com> 写道: > Jason Liu,你好 > > 请教一下"引用数到0"是什么意思? > > > Qutr, qutianrang at gmail.com > 2005-6-14 > ----- 收到以下来信内容 ----- > 发件人: Jason Liu > 收件人: qutianrang,python-chinese > 时 间: 2005-06-14, 13:09:04 > 主 题: Re: [python-chinese] 也问一个关于内存的问题 > > > > 不一定,看引用数到没到0 > > 在 05-6-14,Qutr<qutianrang at gmail.com> 写道: > > python-chinese : > > > > 大家好! > > > > 如果我有一个字典 > > a = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e",.............} > > 把该字典中的内容常驻内存, > > 当用 del a[1] 后内存占用会不会降低? > > > > > > > > > > Qutr, qutianrang at gmail.com > > 2005-6-14 > > _______________________________________________ > > python-chinese list > > python-chinese at lists.python.cn > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > > > -- I like python! My Donews Blog: http://www.donews.net/limodou New Google Maillist: http://groups-beta.google.com/group/python-cn
Zeuux © 2025
京ICP备05028076号