Cerebro (was Re: Almost 50% less free memory in joyride-2302 compared with Update.1 (708))

Polychronis Ypodimatopoulos ypod at mit.edu
Sun Aug 24 05:55:09 EDT 2008


I did the following as a basic test for memory usage of various python 
modules. I did the test on my computer, a 32-bit Centrino laptop running 
ubuntu.

Let's start with the following code:
   
    import gobject
    mainloop = gobject.MainLoop()
    mainloop.run()

Cost: 1.2MB of memory (1.2MB total)


Add a dummy class, like the following:
   
    import dbus
    import dbus.service
    class Dummy(dbus.service.Object):
       pass

Additional cost: 0.9MB of memory (2.1MB total)


Importing some more modules, like the following:

    import time, sys, os, traceback
    from select import select  
    from socket import *
    from random import random
    from struct import pack, unpack
    from optparse import OptionParser
    from os.path import basename

Additional cost: 1.0MB of memory (3.1MB total)


Running the same thing as above as root:
Additional cost: 2.8MB of memory (5.9MB total)  (WHY?!?!?)


Nothing specific to cerebro up to this point.


Running Cerebro fully-blown as root:
Additional cost: 1.3MB of memory (7.2MB total)


It doesn't seem to me that there's much I can do, except for writing 
some parts of Cerebro in C.

Pol

-- 
Polychronis Ypodimatopoulos
Graduate student
Viral Communications
MIT Media Lab
Tel: +1 (617) 459-6058
http://www.mit.edu/~ypod/




More information about the Devel mailing list