[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Memory usage problems with imports and python

arobinson

2/12/2008 4:32:00 PM

I am a developer relatively new to python and brand new to pygtk
development. I wanted to write a bloglines tray icon notifier for my
linux box. Everything is working quite well functionality wise, but
the memory footprint is horrible.

This little tray icon that simply has a thread for updates, a
gtk.StatusIcon, a few relatively small dict objects and a context menu
is running at around 20-25 MB of memory.

Doing some initial research, starting python up takes 1 MB, importing
GTK bumps it up to 4 MB, importing other libraries jumps up to 7 MB
and so on. IMO this code should take up a maximum of 2-4 MB (based on
other linux tray icons and docking programs).

Is this a problem with (a) python, (b) poor memory management of the
python libraries I am using, especially py/gtk or (c) something I am
doing wrong as a developer?

For anyone who wants to help, the code is open source and can be
viewed here:

http://pybloglines.svn.sourceforge.net/viewvc/py...

The "PyBloglinesNotifier" file is the main python program and imports
code from within the bloglines folder.

Thank you,
Andrew