View previous topic :: View next topic |
Author |
Message |
halak79 n00b
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Fri May 26, 2006 4:47 pm Post subject: Optimize my desktop to use less ram? |
|
|
I've got a PIII with 128mb ram, my desktop is Xorg w/ Fluxbox and Rox with the pinboard.
Just booting into the desktop after restarting the computer takes 117000k (or so) of RAM according to top. That seems like alot, considering people get it to work on embedded systems with like 32mb or ram It seems like something might be wrong. How can I optimize this?
Output of top just booting to the command line w/ no X is around 32mb (33000k) If I start x and then exit back to the command line ram usesage goes up to about 70 Mb with no X, but booting back into X it still takes the same, Why is that??
Ram usage right now, after just rebooting and now I am only running x, fluxbox, rox, firefox, and eterm running top is 122000k and 128k of swap.
My 'swappiness' is set to 15, I have the intel i810 integrated chipset set to 16Mb of ram so that is using my system ram since it doesn't actually have any dedicated video ram, or... thats how I think it works, the i810 thing is a little confusing to me.
Any tips/ideas? |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5937
|
Posted: Fri May 26, 2006 4:57 pm Post subject: |
|
|
- try stripping modules from your kernel
- run fewer gettys on startup
- switch to a lighter browser, firefox (or any mozilla product for that matter) has always been a memory hog
- buy more ram
- use less system ram for video output (2, 4, or 8mb should be sufficient depending on what you do graphically) _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
halak79 n00b
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Fri May 26, 2006 5:18 pm Post subject: |
|
|
Thanks for the tips,
Currently only running 2 gettys
How do I stip modules from the kernel? Like do built in instead of module?
I do use dillo sometimes because it's lightening fast, but sometimes I just need to use a more compliant browser, any suggestions on a lighter weight compliant browser? I tried Flock but it actually didn't seem any better with resources.
I plan on buying more ram in like a month or so, my system is an HP ePC C10, which is a small form factor workstation thing w/ only 1 ram slot so the max ram for the system I think is 320mb which is 64mb that is on the board plus a 256mb ram chip, which I think I read was the max for the system.. maybe there is a way to run a 512 chip I don't know. But thats why I want to get base ram usage as low as possible. |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5937
|
Posted: Fri May 26, 2006 5:41 pm Post subject: |
|
|
halak79 wrote: | How do I stip modules from the kernel? Like do built in instead of module? |
not exactly... if you know your system does not have a particular device, you can remove it completely. aka via chipset drivers if you're running an intel... dlink if you're using 3com.... etc. _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
csab Apprentice
Joined: 15 Apr 2005 Posts: 152 Location: Atlanta, GA
|
Posted: Fri May 26, 2006 6:04 pm Post subject: |
|
|
Hi,
I'm running a PIII with 256M RAM, so maybe not at your level, but I also face RAM issues. These are my solutions:
- I don't use any desktop evironments. I use icewm as window manager and it uses very small amount of memory. Xorg does use a fair amount, but I think it is just because it can. E.g. you said that when you shut down X, the system still does not release RAM. I think it is because most parts of the X system is cashed in memory. But don't worry about that: if an application needs RAM, the cache will be released.
- Use the -Os optimization flag for gcc. -O3 and -O2 makes fast binaries but they are big, so if you have lttle RAM, it may be counterproductive. -Os will optimize your binaries for size.
- As said before, compile things as module in your kernel, or if you never need a feature, leave it out.
- Buy a hardware firewall so you don't need to run a software one.
- Don't run any deamon that you don't really need (like NTP). |
|
Back to top |
|
|
lxg Veteran
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Fri May 26, 2006 6:35 pm Post subject: |
|
|
As browser, check out dillo. It's extremly tiny. As a trade-off, you get almost no CSS support or proper display of complex page layouts. However, at least it displays images, so I guess it's better than lynx.
edit: I just realized, dillo was already mentioned in this discussion. So I just second: dillo is a neat browser. And, yes, I've tried others; but dillo appeared the best when not wanting a bloated browser. By the way, Opera is a great browser that needs significantly fewer ressources than Firefox. _________________ lxg.de – codebits and tech talk |
|
Back to top |
|
|
halak79 n00b
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Fri May 26, 2006 10:21 pm Post subject: |
|
|
For csab, how much space savings do you get with -Os? It would require me to recompile like... everything right? But then again this system also only has a 10G hard drive so I kinda need to conserve space...
------------------------------
What got me started on this whole thing is that something like an iPAQ with 32mb ram can run Linux with X and a window manager and it seems to work fine, so I got to thinking like "Why isn't my X setup only using 32mb ram" But then again they have a special version of X for embedded systems I think... But then there is Damn Small Linux which is like 49mb and says it works on a 486 w/ 16mb or ram and runs X and fluxbox and has firefox too...
I guess I just don't know what to benchmark it against... is 32mb of ram usage OK for a system that has just booted up w/ no X? Is 100mb ram usage normal for just booting into X?
Dillo is amazing I mean the speed of going back or loading a page, it's so fast. And has tabbed browsing and stuff... I wish there was a plugin or something to add javascript and css.
All the gtk 1 apps look really clunky with gtk2, maybe there is something that can be done about that, I dunno. It's pretty minor anyway.
Thanks for the responses you guys.
I'm going to get the DSL live cd and see if it is less intense on the resources. If so maybe there is something I can barrow from that setup to lighten my gentoo setup. |
|
Back to top |
|
|
csab Apprentice
Joined: 15 Apr 2005 Posts: 152 Location: Atlanta, GA
|
Posted: Sat May 27, 2006 12:58 am Post subject: |
|
|
halak79 wrote: | For csab, how much space savings do you get with -Os? It would require me to recompile like... everything right? But then again this system also only has a 10G hard drive so I kinda need to conserve space... |
I never made an exact measurement, so I don't exactly know how much space you save...
You don't have to recompile everything, just the things that are big and you use them frequently. X and firefox for a start. Later, with updates, everything gets recompiled eventually. |
|
Back to top |
|
|
Solicitous n00b
Joined: 27 Nov 2004 Posts: 21 Location: TAS, Australia
|
Posted: Sat May 27, 2006 7:32 am Post subject: |
|
|
Well I use on a semi-regular basis an old NEC laptop (P233mhz, 128mb ram) with Gentoo.
I use Opera when I need a half-decent browser on my system. The boot time for Opera is quite reasonable on this old computer, and doesn't feel sluggish when browsing.
I do however use ratpoison as my DE, so I don't know if that uses a great deal less resources than fluxbox.
Just an idea.
Now if only I could cut back the install size I'd be as happy as a pig in s**t. |
|
Back to top |
|
|
lxg Veteran
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Sat May 27, 2006 8:27 am Post subject: |
|
|
Solicitous wrote: | Now if only I could cut back the install size I'd be as happy as a pig in s**t. |
Try compiling with -Os, clean out /usr/portage/disfiles every now and then, and especially take a look into /usr/share. There is so much useless stuff like ./doc or ./info and others that you can delete and save some 100 megs.
Another idea might be to set the minimal USE flag, so Portage will automatically ensure To slim down the amuont of installed files. (A good idea is to set minimal in /etc/make.conf; however, it must be unset for some packages like Perl and X in /etc/portage/package.use, or they won't work properly.)
edit: Another idea: If you have a large amount of files on your harddisk that (a) are in one folder and (b) are used readonly, you could consider to put them into a squashfs: It can be easily handled as a loopback device, it has a reasonable overhead and it compresses your data up to 33% of the original amount. _________________ lxg.de – codebits and tech talk |
|
Back to top |
|
|
StringCheesian l33t
Joined: 21 Oct 2003 Posts: 887
|
Posted: Sat May 27, 2006 6:41 pm Post subject: |
|
|
Here's every ram/hd saving tip I can think of that hasn't been mentioned:
1. For 20 MB or so of HD space emerge localepurge: it deletes gettext language files, man pages, etc that aren't in the language(s) you tell it to keep.
2. http://kb.mozillazine.org/Reducing_memory_usage_(Firefox) ...ARG! Stupid PhpBB! The "(Firefox)" is part of the URL.
3. Opera really does use less memory.
4. Fine tune your USE flags to eliminate some shared libraries and therefore memory usage. |
|
Back to top |
|
|
halak79 n00b
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Sat May 27, 2006 7:34 pm Post subject: |
|
|
Any specific tips on fine tuning the use flags besides the already mentioned 'minimal'?
Would this be like just having less use flags so the apps are linked against less libraries?
Wow... /usr/portage/distfiles was takingup 1 gig!
Thanks for that tip.
Thanks, |
|
Back to top |
|
|
GentlemanFinn Tux's lil' helper
Joined: 19 Jul 2005 Posts: 85 Location: Denmark
|
Posted: Sat May 27, 2006 9:28 pm Post subject: |
|
|
StringCheesian wrote: | Here's every ram/hd saving tip I can think of that hasn't been mentioned:
1. For 20 MB or so of HD space emerge localepurge: it deletes gettext language files, man pages, etc that aren't in the language(s) you tell it to keep.
2. http://kb.mozillazine.org/Reducing_memory_usage_(Firefox) ...ARG! Stupid PhpBB! The "(Firefox)" is part of the URL.
3. Opera really does use less memory.
4. Fine tune your USE flags to eliminate some shared libraries and therefore memory usage. |
Thanks for #1, it just gave me 200 mb free space, about #2 one could always use epiphany if one want a gtk based browser with a little less use of mb then firefox. |
|
Back to top |
|
|
StringCheesian l33t
Joined: 21 Oct 2003 Posts: 887
|
Posted: Sun May 28, 2006 12:44 am Post subject: |
|
|
halak79 wrote: | Any specific tips on fine tuning the use flags besides the already mentioned 'minimal'?
Would this be like just having less use flags so the apps are linked against less libraries? |
Usually. The default USE flags are already pretty minimal.
These might help: USE="-gnome -kde -arts -esd"
And if you don't need printing: "-cups" too.
Then add entries in /etc/portage/package.use to turn on USE flags that are internal/external switches.
For example, xine-lib has ffmpeg built in. If you turn on the ffmpeg USE flag, it'll use the externally built ffmpeg instead, which can save you from having 2 different ffmpegs on your hd (and possibly in memory) - one inside xine and another as a dependency of some other app. |
|
Back to top |
|
|
|