Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: cortman on April 01, 2013, 11:39:04 AM
-
I realize this is kind of a fundamental aspect of TinyCore, but I am curious.
I have a very old laptop that runs TC fairly well, and as it has no real networking capabilities I am really thankful for TC's SCM repository.
However this machine only has 64 MB of RAM. The base TC system alone uses up almost 50 MB when it is loaded at startup. Extra packages to load would max the machine out very fast.
Therefore I was wondering if there was any way I could run TC without having it load to RAM, so I would be able to run more applications and use my 64 MB a little better. I'd like to run TC straight from the HDD.
Or is it possible (if I can't run it from the HDD) to have it load to a swap partition and run from there?
Thanks.
-
You can reduce the memory footprint with the opt= and home= boot options.
Don't forget to remove opt and home from /opt/.filetool.lst.
With all the extensions loop mounted, that will leave very little in RAM.
Running root from hard disk is NOT supported. You will have to find a different distribution if that is a requirement.
-
OK, thanks for clearing that up.
My other question was whether or not I could have TC load to a swap partition instead of RAM?
Thanks.
-
Hi cortman
My other question was whether or not I could have TC load to a swap partition instead of RAM?
I don't think so. Try adding the boot code nozswap to reduce Ram usage, see:
http://forum.tinycorelinux.net/index.php/topic,15096.msg86542.html#msg86542
-
If you have a formatted swap partition, Core will find it and use it automatically.
You need to add a nozswap boot option to disable the RAM zswap.
-
My other question was whether or not I could have TC load to a swap partition instead of RAM?
The question starts from a wrong base, "instead" does not apply; it's in the kernels competence to decide which data of tmpfs swapped to disk and when.
However, you can tune the kernels tendencies as follows:
As root (not sudo) do
echo 100 >/proc/sys/vm/swappiness
echo 100000 >/proc/sys/vm/vfs_cache_pressure
could optimize usage of RAM in favor of needs of programs.
As an alternative to a swap partition you could use a swapfile named "tc.swp" and use boot code "swapfile=".
-
Perhaps I'll try what you detail there. Thanks for the info. I'll post back if I run into anything more.
-
OK. I have a base system, no extensions added, and I have removed wbar from the onboot list. I'm still using about 54 MB of RAM.
I ran the codes given by tinypoodle and i am using about 52 MB.
I really need to get this down around 20 MB or less.
What else can I do to lower RAM usage?
Is there any way to run the kernel from the HDD instead of loading it to RAM?
My boot codes are as follows:
tce=sda1
home=sda1
opt=sda1
multivt
host=shagrat
vga=788
nozswap
-
Further. I cp'd onboot.lst to onboot.lst.bak and removed everything from onboot.lst except
Xvesa.tcz
Xlibs.tcz
Xprogs.tcz
flwm_topside.tcz
which involved removing some wireless firmware stuff (although I will probably want at least some of that at some point) and that got the RAM usage down to about 33 MB, which is much better, but still needs to be lower.
-
Hi cortman
How are you measuring RAM usage? Using the free command? If so, did you also remember to clear the cache first?
sudo cache-clear
freetc@box:~/tcprovides$ free
total used free shared buffers
Mem: 512184 455304 56880 0 18368
-/+ buffers: 436936 75248
Swap: 1047548 116628 930920
tc@box:~/tcprovides$ sudo cache-clear
tc@box:~/tcprovides$ free
total used free shared buffers
Mem: 512184 328972 183212 0 308
-/+ buffers: 328664 183520
Swap: 1047548 116492 931056
-
OK. I have a base system, no extensions added, and I have removed wbar from the onboot list. I'm still using about 54 MB of RAM.
I ran the codes given by tinypoodle and i am using about 52 MB.
I really need to get this down around 20 MB or less.
Install htop, it will show you memory usage in detail, distinguishing buffers and cache.
Run 'sudo cache-clear' each time before measuring memory.
Is there any way to run the kernel from the HDD instead of loading it to RAM?
The Linux kernel is always fully loaded in RAM, totally regardless of any circumstances.
My boot codes are as follows:
multivt
You can certainly save memory of getty or login shell processes running by omitting multivt boot code.
-
http://www.linuxatemyram.com/ ;)
-
Oh, and besides from using htop, you could run the 'watcher' extension to monitor 'net' mem usage.
-
Thanks for the replies. I removed multivt which saved some. I'm down to about 22 MB now.
Getting close, but I'd still like it to be lighter. Especially as I'm not loading an programs at boot either.
Is there anything more I can do other than start trimming the kernel?
I'm thinking that's probably next.
-
Hi cortman
What is the output for:
lsmod
-
http://forum.tinycorelinux.net/index.php/topic,9028.msg49291.html#msg49291
Unload (modprobe -r) all modules you think you will never use before running that script.
I wouldn't complain about 22MB when official minimal requirement is 46 MB ;)
-
Lowering depth and/or resolution of framebuffer and/or X could squeeze out some more, short of omitting framebuffer and/or X entirely.
-
Hi Rich,
Output is
acpi_cpufreq
mperf
cpufreq_userspace
cpufreq_conservative
cpufreq_powersave
cpufreq_stats
squashfs
pcspkr
scsi_wait_scan
loop
I'm not posting the full output because I have to manually type everything out, but the value for the "Size" column is 12288 for nearly all of them.
-
acpi_cpufreq
mperf
cpufreq_userspace
cpufreq_conservative
cpufreq_powersave
cpufreq_stats
http://forum.tinycorelinux.net/index.php/topic,15096.msg87339.html#msg87339
I'm not posting the full output because I have to manually type everything out, but the value for the "Size" column is 12288 for nearly all of them.
What about transferring a file?
lsmod > lsmod.log
-
Hi cortman
lsmod > lsmod.txtThen you can copy lsmod.txt to a USB thumb and copy/paste on the machine you post from.
-
Hi cortman
lsmod > lsmod.txtThen you can copy lsmod.txt to a USB thumb and copy/paste on the machine you post from.
Obviously. *facepalm. ::)
Module Size Used by Not tainted
acpi_cpufreq 12288 0
mperf 12288 1 acpi_cpufreq
cpufreq_userspace 12288 0
cpufreq_conservative 12288 0
cpufreq_powersave 12288 0
cpufreq_stats 12288 0
squashfs 24576 8
pcspkr 12288 0
scsi_wait_scan 12288 0
loop 16384 16
Thanks for all the help so far!
-
acpi_cpufreq
mperf
cpufreq_userspace
cpufreq_conservative
cpufreq_powersave
cpufreq_stats
http://forum.tinycorelinux.net/index.php/topic,15096.msg87339.html#msg87339
I'm not posting the full output because I have to manually type everything out, but the value for the "Size" column is 12288 for nearly all of them.
What about transferring a file?
lsmod > lsmod.log
And I can keep these from loading at boot by adding a blacklist="acpi_cpufreq" boot code? (that particular module as an example)?
-
Probably, but see reply #15 which could discard unused modules from initrd entirely.