[BangPypers] how to relclaim memory

Prashanth Ellina prashanthellina at gmail.com
Thu Oct 23 12:18:40 CEST 2008


Python 2.5 (unlike 2.4 and earlier versions) is expected to release memory
back to the OS when objects are de-referenced. Considering that I would
suspect that you are still holding references to python objects.

Do you have an objects of user defined classed which define the __del__()
method? If yes, this would lead to an issue with for GC when collecting for
circularly referenced objects.

The gc module has some methods to help is figuring out what objects are
still referenced. That would be a good starting point to track down memory
issues.

HTH,
Prashanth

On Thu, Oct 23, 2008 at 3:30 PM, Sibtey Mehdi <sibteym at infotechsw.com>wrote:

>
> I am using
>         Windows XP,
>         pythn 2.5, wxpython 2.8, pygame 1.8.
>
> Application over View:
> In my application I am creating a dialog box that shows a treeView items
> but
> on closing of that dialog box I delete the objects that contains the tree
> items. So I am trying to get that memory used by that tree items.
>
> Thanks,
> Sibtey
>
>
> Sibtey Mehdi <sibteym at infotechsw.com> wrote:
> > Hi
> >
> > My system is showing 900MB usage of memory, I have deleted some object
> (del
> > pythonObj) but the memory is not returned to os, I have also tried
> > gc.collect() and del (gc.garbage) but  still the system is showing 900MB
> > usage.
>
> "Watson, I have no data yet. It is a capital mistake to theorize
> before one has data. Insensibly one begins to twist facts to suit
> theories, instead of theories to suit facts."
>
> Give me more data like the OS, Python version, any other applications
> running,
> virtual memory (swap memory) size etc.
>
> >
> > Is there anyway to reclaim the memory?
>
> Not enough data to go on :)
>
> >
> >
> >
> >
> >
> > Thanks,
> >
> > Sibtey
> >
> >
> >
> > _______________________________________________
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
http://blog.prashanthellina.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20081023/b4038ce6/attachment.htm>


More information about the BangPypers mailing list