Re: "Help needed - I don't understand how Python manages memory"

2008-04-22 Thread Lie
On Apr 21, 1:14 am, "Hank @ITGroup" <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > Gabriel Genellina schrieb: > > >> Apart from what everyone has already said, consider that FreqDist may > >> import other modules, store global state, create other objects... whatever. > >> Pure python cod

Re: "Help needed - I don't understand how Python manages memory"

2008-04-21 Thread sturlamolden
On Apr 21, 4:09 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > I'm not sure if this will help the OP at all - going into a world of dangling > pointers, keeping track of ownership, releasing memory by hand... One of the > good things of Python is automatic memory management. Ensuring that

Re: "Help needed - I don't understand how Python manages memory"

2008-04-21 Thread Andrew MacIntyre
Hank @ITGroup wrote: > In order to deal with 400 thousands texts consisting of 80 million > words, and huge sets of corpora , I have to be care about the memory > things. I need to track every word's behavior, so there needs to be as > many word-objects as words. > I am really suffering from th

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 17:19:43 -0300, sturlamolden <[EMAIL PROTECTED]> escribió: > On Apr 20, 9:09 pm, "Hank @ITGroup" <[EMAIL PROTECTED]> wrote: > >> Could you please give us some clear clues to obviously call python to >> free memory. We want to control its gc operation handily as we were >> using

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 17:23:32 -0300, Christian Heimes <[EMAIL PROTECTED]> escribió: > Martin v. Löwis schrieb: >> Can you give an example, please? > > http://trac.edgewall.org/ contains at least one example of a reference > leak. It's holding up the release of 0.11 for a while. *scnr* > > The prob

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Steve Holden
Hank @ITGroup wrote: > Steve Holden wrote: >> You are suffering from a pathological condition yourself: the desire >> to optimize performance in an area where you do not have any problems. >> I would suggest you just enjoy using Python and then start to ask >> these questions again when you have

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Martin v. Löwis
> http://trac.edgewall.org/ contains at least one example of a reference > leak. It's holding up the release of 0.11 for a while. *scnr* All my investigations on possible memory leaks in Trac have only confirmed that Python does _not_, I repeat, it does *NOT* leak any memory in Trac. Instead, wha

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Christian Heimes
Martin v. Löwis schrieb: > Can you give an example, please? http://trac.edgewall.org/ contains at least one example of a reference leak. It's holding up the release of 0.11 for a while. *scnr* The problem is also covered by the docs at http://docs.python.org/dev/library/sys.html#sys.exc_info Chr

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread sturlamolden
On Apr 20, 9:09 pm, "Hank @ITGroup" <[EMAIL PROTECTED]> wrote: > Could you please give us some clear clues to obviously call python to > free memory. We want to control its gc operation handily as we were > using J**A. If you want to get rid of a Python object, the only way to do that is to get r

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Christian Heimes
Hank @ITGroup schrieb: > In order to deal with 400 thousands texts consisting of 80 million > words, and huge sets of corpora , I have to be care about the memory > things. I need to track every word's behavior, so there needs to be as > many word-objects as words. > I am really suffering from the

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Hank @ITGroup
Steve Holden wrote: > > You are suffering from a pathological condition yourself: the desire > to optimize performance in an area where you do not have any problems. > I would suggest you just enjoy using Python and then start to ask > these questions again when you have a real issue that's stop

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Martin v. Löwis
> In order to deal with 400 thousands texts consisting of 80 million > words, and huge sets of corpora , I have to be care about the memory > things. I need to track every word's behavior, so there needs to be as > many word-objects as words. > I am really suffering from the memory problem, even 4G

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 15:02:37 -0300, Torsten Bronger <[EMAIL PROTECTED]> escribió: > Gabriel Genellina writes: >> En Sun, 20 Apr 2008 14:43:17 -0300, Christian Heimes <[EMAIL PROTECTED]> >> escribió: >>> Gabriel Genellina schrieb: >>> Apart from what everyone has already said, consider that >>

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Martin v. Löwis
> Pure Python code can cause memory leaks. No, that's not a bug in the > interpreter but the fault of the developer. For example code that messes > around with stack frames and exception object can cause nasty reference > leaks. Can you give an example, please? Regards, Martin -- http://mail.pyt

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Hank @ITGroup
Christian Heimes wrote: > Gabriel Genellina schrieb: > >> Apart from what everyone has already said, consider that FreqDist may import >> other modules, store global state, create other objects... whatever. >> Pure python code should not have any memory leaks (if there are, it's a bug >> in th

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Torsten Bronger
Hallöchen! Gabriel Genellina writes: > En Sun, 20 Apr 2008 14:43:17 -0300, Christian Heimes <[EMAIL PROTECTED]> > escribió: > >> Gabriel Genellina schrieb: >> >>> Apart from what everyone has already said, consider that >>> FreqDist may import other modules, store global state, create >>> other o

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 14:43:17 -0300, Christian Heimes <[EMAIL PROTECTED]> escribió: > Gabriel Genellina schrieb: >> Apart from what everyone has already said, consider that FreqDist may import >> other modules, store global state, create other objects... whatever. >> Pure python code should not h

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Christian Heimes
Gabriel Genellina schrieb: > Apart from what everyone has already said, consider that FreqDist may import > other modules, store global state, create other objects... whatever. > Pure python code should not have any memory leaks (if there are, it's a bug > in the Python interpreter). Not-carefull

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 09:46:37 -0300, Hank @ITGroup <[EMAIL PROTECTED]> escribió: > ``starting python``# == Windows Task Manager: > Python.exe *4,076 *K memory-usage == > >>> st1='abcdefg'*99 # == 10,952 K == > >>> del st1 # == *

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Steve Holden
Hank @ITGroup wrote: > Apology for the previous offensive title~~ > :) > Thanks, Rintsch, Arnaud and Daniel, for replying so soon. > > I redid the experiment. What following is the record - > > ``starting python``# == Windows Task Manager: > Python.exe *4,076 *K memory-u

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread sturlamolden
On Apr 20, 2:46 pm, "Hank @ITGroup" <[EMAIL PROTECTED]> wrote: > That is my question, after ``del``, sometimes the memory space returns > back as nothing happened, sometimes not... ... > What exactly was happening??? Python has a garbage collector. Objects that cannot be reached from any scope is

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Marc 'BlackJack' Rintsch
On Sun, 20 Apr 2008 22:46:37 +1000, Hank @ITGroup wrote: > Apology for the previous offensive title~~ > :) > Thanks, Rintsch, Arnaud and Daniel, for replying so soon. > > I redid the experiment. What following is the record - > > ``starting python``# == Windows Task Manag

Re: "Help needed - I don't understand how Python manages memory"

2008-04-20 Thread Hank @ITGroup
Apology for the previous offensive title~~ :) Thanks, Rintsch, Arnaud and Daniel, for replying so soon. I redid the experiment. What following is the record - ``starting python``# == Windows Task Manager: Python.exe *4,076 *K memory-usage == >>> st1='abcdefg'*99