[Tutor] Shelve del not reducing file size

Alan Gauld alan.gauld at btinternet.com
Sun Jul 29 00:11:56 CEST 2007


"Eric Brunson" <brunson at brunson.com> wrote
> On Sat, July 28, 2007 4:01 am, Thorsten Kampe wrote:
>>> In what way is it Python's fault that the dbm database doesn't 
>>> reclaim
>>> disk space?
>>
>> It's actually how most databases work. Even a simple Outlook pst 
>> file
>> (which is a database, too) works this way. I thought everyone knows 
>> or
>> heard about this.
>
> I don't even think mysql reclaims disk space unless you intervene.

Its actually more efficient for databases to do this, because when 
they
grow beyond the size of the file they need to reallocate extra disk
space which is slow but because they hold onto space from deleted
records the space is usually there ready for reuse. Unix does the
same thing with RAM too. If you run a process which grabs lots of
memory and then frees it again you will see the process memory
useage climb, but never drop! This can be a problem if the process
grabs a lot of RAM on initialisation but then frees it all up again
during normal operation. We used to have a GUI that grabbed
around 200MB on startup but actually only used around 8-12 in
normal use, but its memory footprint was alway 200M!

HTH,

Alan G. 




More information about the Tutor mailing list