Any Tips for Reducing Memory Usage

Discuss Sugar, upgrades and developer perspectives.

Any Tips for Reducing Memory Usage

Postby superimposedmedia » Sun Sep 06, 2009 11:33 pm

I'm running "top" on three machines, comparing the overall memory usage and I'm kinda surprised.
These stats are only using Terminal after startup.

Machine 01 OLPC build 802
Mem: 228404k total, 206052k used, 25352k free

Machine 02 OLPC build 656
Mem: 237844k total, 222780k used, 15064k free

Machine 03 OLPC build 656
Mem: 237844k total, 221384k used, 16460k free

Python is running in four instances on each machine using 14.4, 7.8, 5.4, 3.4pct.
Journal uses 13pct on the 802 and 9.5pct on the other two machines.
Terminal uses 10pct. This is what baffles me, since the installation program is under 100Kb.
X uses 3pct.

Why are there four or five Python instances? Is there any way to reduce the Python usage? I'm not extremely programmer savvy but with this current configuration, I am near maxing out the memory by running a terminal and Firefox at the same time. I realize these machines are not workhorses but 80 percent of the resources are used simply to run the machine.
I'm currently configuring three xos, two for my nieces and one for myself.
myspace.com/superimposedmedia
superimposedmedia
 
Posts: 19
Joined: Thu Aug 06, 2009 2:50 am

Re: Any Tips for Reducing Memory Usage

Postby manymny » Mon Sep 14, 2009 1:28 am

superimposedmedia wrote:Why are there four or five Python instances? Is there any way to reduce the Python usage?


python is an interpreter, much of sugar is based on python. every time you run a script (or an activity, or presumably a number of other things) python is loaded to run it. for something like the python interpreter, it may seem like a lot (good thing python is designed to run a number of things) but it's the conceptual equivalent of having one instance of bash running for each script you're running. i can't imagine how one python process can run more than one script at a time.
manymny
 
Posts: 26
Joined: Mon Aug 17, 2009 11:26 am

Re: Any Tips for Reducing Memory Usage

Postby ektoric » Mon Sep 14, 2009 3:25 am

manymny wrote:i can't imagine how one python process can run more than one script at a time.

If you're really interested in the nitty gritty tech stuff, read up on "threading". But that's a complete tangent. Interesting, but not related to the original question at hand :)

Actually, manymny already answered the question perfectly. Sugar, and its many Activities are indeed Python applications. There is no way for you to use Sugar and Activities without using Python. I'm afraid you're limited to the amount of physical RAM with no swap (swap is rough on flash memory) so you may have to just run fewer Activities.

On, yet another, tangent, if you plan on using your XO without Sugar, then you can use something like XFCE and your own downloaded applications. You'd be surprised at how snappy the XO can be in that environment.
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Any Tips for Reducing Memory Usage

Postby superimposedmedia » Mon Sep 14, 2009 7:18 pm

Thanks for the replies. I was checking out XFCE and it looks like it would be good. Have you tried this yourself? If so, what is your memory usage while simply running the desktop by itself and a terminal window running "top"? Also, can you still run the Activities?

[quote="manymny"]python is an interpreter, much of sugar is based on python. every time you run a script (or an activity, or presumably a number of other things) python is loaded to run it. for something like the python interpreter, it may seem like a lot (good thing python is designed to run a number of things) but it's the conceptual equivalent of having one instance of bash running for each script you're running. i can't imagine how one python process can run more than one script at a time.[/quote]

I guess what I was leaning towards, was losing an instance of python along with which ever script it was running. Looking at the running commands though, they all seem necessary. I'll have to do a little more research.
I'm currently configuring three xos, two for my nieces and one for myself.
myspace.com/superimposedmedia
superimposedmedia
 
Posts: 19
Joined: Thu Aug 06, 2009 2:50 am

Re: Any Tips for Reducing Memory Usage

Postby manymny » Fri Sep 18, 2009 4:50 am

ektoric wrote:
manymny wrote:i can't imagine how one python process can run more than one script at a time.

If you're really interested in the nitty gritty tech stuff, read up on "threading".


cool, is that what that does? i've read enough to be familiar with the generic term, i didn't know it gave python the capability of more than one script in a single process. obviously (as you admitted when you called it a tangent) that won't do anything for super, but thanks, i do think that's interesting (if perhaps too advanced for me yet.) i haven't heard much talk of "threading" since the days when microsoft began pushing win32 applications and the nt platform.

i love xfce, i don't know if it will offer a more memory-efficient platform than sugar, i care more about lightweight distros than heavier ones, but the "heavy" ones i love are xubuntu and sugar-on-a-stick, xubuntu has xfce (so can sugar on a stick, i believe) which gives it some compatibility with gnome and kde, while it tends to be (truly) more efficient than either.

if what you're really going for is efficiency, xfce is (in my opinion) the lightest and the most luxurious of the medium-to-heavy choices. to get lighter than xfce, you begin to sacrifice features (which enough users feel are not needed.) the suite built around xfe (nothing to do with xfce- three letters in common, no relation) or pcmanfm might be as good as it gets, but i'm happy with even more lightweight options and even fewer features, like blackbox (which you can try in x-windows activity.)

as to activities without sugar, what is sugar? i try to get this technical info right and up to date, but i think whether you mean what ships with the xo-1 or the more universal sugar-on-a-stick (that i use, i don't have an xo-1, i wish i owned one) you're talking about a lightweight fedora gnu/linux, running python, and python runs sugar/activties. there are components besides the operating system, though for the most part sugar is activities.i can't imagine anything you could separate "from sugar" would be lighter than the activities themselves, maybe i'm wrong. xfce is probably faster as it's compiled, not sure it conserves more resources. sugar is interpreted so people can learn how to modify just about everything without recompiling, which i think is the coolest thing ever- it's not for everyone, but a kid -can- do it.
manymny
 
Posts: 26
Joined: Mon Aug 17, 2009 11:26 am


Return to Sugar, Linux and System Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron