473,778 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Memory usage problems with imports and python

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.n...c/pybloglines/

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

Thank you,
Andrew
Feb 12 '08 #1
0 1068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2037
by: Guy | last post by:
Hi It might take me a little time to explain this but here goes. Firstly I'm not using the latest upto date python releases so my first plan is to try more upto date rels of python and win32 libs, as this has fixed problems for me in the past (Don't like doing this as it usally breaks stuff and sys admin are slow to update software, although they do a cracking job, just covering my back.) I've created a build script for my companies...
4
8448
by: Brad Tilley | last post by:
When memory usage is a concern, is it better to do: from X import Y or import X Also, is there a way to load and unload modules as they are needed. I have some scripts that sleep for extended periods during a while loop
1
2524
by: lotmr | last post by:
I have previously posted a simple app I am working on, and while I love python and wxWindows, after checking the memory usage on such a simple app (system try application launcher) I see that it climbs to over 17mb! I have reduced all my imports to the bare workable minimum and that just gets it under 17mb. Is there any way that I could compile or optimize the my program and/or its memory usage? (Note: I don't have a problem with making...
13
4492
by: placid | last post by:
Hi All, Just wondering when i run the following code; for i in range(1000000): print i the memory usage of Python spikes and when the range(..) block finishes execution the memory usage does not drop down. Is there a way of freeing this memory that range(..) allocated?
5
306
by: Rolf Wester | last post by:
Hi, I have a strange (for me) memory problem. When running a loop in a Python program memory usage increases from about 4% up to 100%. I do a gc.collect() every loop cycle but this doesn't help. There are about 67000 objects that are tracked by the garbage collector. This number does vary a little bit but does not increase on average whereas the memory usage does. The number of garbage objects (len(gc.garbage()) is zero. This is a very...
13
2861
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure. It's most possibly caused by trac and it's dependencies, but several components of the OS where updated, too.
0
150
by: Steve Holden | last post by:
Hank @ITGroup wrote: It doesn't really make that much sense to watch memory usage as you have been doing. Your first test case appears to trigger a specific pathology, where the memory allocator actually returns the memory to the operating system when the garbage collector manages to free all of it. Most often this doesn't happen - a chunk of memory might be 99.99% free but still have one small piece used, and so while there is a large...
1
2047
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after the objects for which that memory was allocated are no longer live in the process. This is only a leak if peak memory goes up again each time you create any new objects. Try repeated allocations of a large dictionary and observe how memory...
2
1677
by: gaurav kashyap | last post by:
Dear all, I have a server program that listens to a particular port and a number of client programs that connect to the server. Now i want to put some data in form of python list in main memory on server.Hence whenver a client program is run it connects to the server and access the data in main memory.Here the server calls a module that processes the data as per the client request and the returns some information to the client.
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.