shelf-like list?

Dave Angel davea at ieee.org
Sun Aug 15 14:39:26 CEST 2010


kj wrote:
> <snip>
>>            self.save()
>>     
>
> Even though it is saved periodically to disk, it looks like the
> whole list remains in memory all the time?  (If so, it's not what
> I'm looking for; the whole point of saving stuff to disk is to keep
> the list's memory footprint low.)
>
> ~K
>
>   
It sounds like we all made the wrong assumption about your 
requirements.  It's not persistence you want, but low memory footprint 
?  Do you or don't you also want the data to survive multiple runs of 
the program?

If you want the data to be in a persistent disk file, you probably 
should use a database.  And if you don't, then you could either increase 
the size of your swapfile, or use a more complex scheme to do a memory 
mapped file while the program is running, and delete it on exit.  The 
swapfile is likely to be execute  more quickly than anything else you 
could cook up in pure python.

DaveA




More information about the Python-list mailing list