Python论坛  - 讨论区

标题:Re: Re: [python-chinese] 也问一个关于内存的问题

2005年06月14日 星期二 13:11

Qutr qutianrang at gmail.com
Tue Jun 14 13:11:20 HKT 2005

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

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年06月14日 星期二 13:47

limodou limodou at gmail.com
Tue Jun 14 13:47:31 HKT 2005

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

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号