How much memory used by a name

Bernard Lebel 3dbernard at gmail.com
Wed Feb 14 15:41:23 EST 2007


Diez: thanks, I will try that. However isn't sum() returning an
integer that here would represent the number of elements?


Bruno: good question. We're talking about text files that can have
300,000 lines, if not more. Currently, the way I have coded the file
writing, every line calls for a write() to the file object, which in
turns write to the text file. The file is on the network.

This is taking a long time, and I'm looking for ways to speed up this
process. I though that keeping the list in memory and dropping to the
file at the very end could be a possible approach.


Bernard




On 2/14/07, Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> wrote:
> Bernard Lebel a écrit :
> > Hello,
> >
> > I would like to know if there is a way to know how much memory (bytes,
> > kilobytes, megabytes, etc) a name is using.
> >
> > More specifically, I have this list of strings that I want to write to
> > a file as lines.
> > This list grows througout the script execution, and toward the end,
> > the file is written.
>
> Do you really need to first grow the list then write it ?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list