[Dev] repository footprint spelunking

Ted Leung twl at osafoundation.org
Wed Mar 3 15:38:46 PST 2004


As a result of today's IRC regarding parcel loading (see 
<http://aloha.osafoundation.org/~jbotz/irc-logs/chandler.log.20040303> 
around 14:40), I decided to do a tiny bit of spelunking into the 
footprint of the repository.  This is a *very* *crude* investigation, 
which I performed by starting up an interpreted Chandler python, typing 
commands into it and then running ps uxw to get an idea of the memory 
consumption.

[squeak:2035]> hardhat -i
USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  0.3    35164   3316  p4  S+    3:04PM   0:00.32 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

Our Python starts out with a 35MB virtual memory allocation and a 3MB 
resident set

 >>> from repository.persistence.XMLRepository import XMLRepository
USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  1.9   107776  20432  p4  S+    3:04PM   0:02.40 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

Loading the XML repository takes us up to 107MB and a 20MB resident set

import os
 >>> rootdir = os.environ['CHANDLERHOME']
 >>> testdir = os.path.join(rootdir,'Chandler','repository','tests')
 >>> rep = XMLRepository(os.path.join(testdir, '__repository__'))

USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  1.9   107776  20432  p4  S+    3:04PM   0:02.40 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

 >>> rep.create()

USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  2.6   143276  27736  p4  S+    3:04PM   0:02.95 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

Creating a repository takes us up to 143MB and a 27MB resident set

 >>> schemaPack = 
os.path.join(rootdir,'Chandler','repository','packs','schema.pack')

USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  2.6   143276  27736  p4  S+    3:04PM   0:02.95 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

 >>> rep.loadPack(schemaPack)

USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  2.9   144428  30664  p4  S+    3:04PM   0:03.69 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

Loading the base schema only adds 1MB of VSZ but 3MB of RSS

 >>> rep.commit()

USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
twl  20966   0.0  3.0   144428  31008  p4  S+    3:04PM   0:04.19 
/Users/twl/work/osaf/osaf/chandler/release/Library/Frameworks/Pyth

Committing increases the RSS by 1 MB

I hope this is a start at looking at our overall footprint issues.
----
Ted Leung                 Open Source Applications Foundation (OSAF)
PGP Fingerprint: 1003 7870 251F FA71 A59A  CEE3 BEBA 2B87 F5FC 4B42



More information about the Dev mailing list