Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: xpto09 on September 28, 2009, 08:01:47 PM

Title: what are the differences between install the extensions to RAM or mount them?
Post by: xpto09 on September 28, 2009, 08:01:47 PM
I read this in a topic:
Code: [Select]
You can either install the extensions to RAM or mount them.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: Guy on September 29, 2009, 04:32:16 AM
If you install all of the extensions to ram, all programs are loaded to ram when you start the computer. When you start a program, the computer will access it from ram. If you install a lot of programs, and use this method, you may require more ram than most other operating systems.

If you mount extensions, the operating system knows where they are on the hard drive. When you start a program, the computer will access it from the hard drive. This method only requires the same amount of ram as other operating systems.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: tclfan on September 29, 2009, 03:59:29 PM
If you install all of the extensions to ram, all programs are loaded to ram when you start the computer. When you start a program, the computer will access it from ram. If you install a lot of programs, and use this method, you may require more ram than most other operating systems.

If you mount extensions, the operating system knows where they are on the hard drive. When you start a program, the computer will access it from the hard drive. This method only requires the same amount of ram as other operating systems.
Just to be myself clear on this terminology:  Do we equate here mounting extensions with TCZ loop mounting vs. TCE loading in memory?
I thought all along that tcz will save some memory, but not a lot comparing to tce, at least not nearly comparing to when programs (extensions) reside in storage and are loaded when called upon to execute...
Can we please clarify this memory usage?
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: gerald_clark on September 29, 2009, 04:04:41 PM
When saved to memory, it takes up memory twice.
Once in the RAM disk, and once again in memory when running.
When mounted, only the running code is in memory.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: jls on September 29, 2009, 04:58:20 PM
I removed many tcz from my tce dir, rebooted and now I have a lot more free ram.
Looks like this mounted tcz uses a lot of ram
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: roberts on September 29, 2009, 08:06:13 PM
Simple answer. Mounting will allow many more, or larger, extensions to be used than ram loading them.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: tclfan on September 30, 2009, 08:48:18 AM
I removed many tcz from my tce dir, rebooted and now I have a lot more free ram.
Looks like this mounted tcz uses a lot of ram
I read some time ago a memory usage benchmark between tcz and tce types and the difference was something like 20-30%. There is no question in my mind that tcz style is superior, but if I can quote assessment of gerald_clark:
"When saved to memory, it takes up memory twice.
Once in the RAM disk, and once again in memory when running.
When mounted, only the running code is in memory."

Then where is this memory used, if tcz is loop mounted from storage HD or USB), not RAM disk?




Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: Guy on September 30, 2009, 09:13:14 AM
There is a time when running entirely from ram is advantageous.

If you are running from something which reads slowly, such as a cd, the operating system will run faster if loaded to ram so it does not need to read the cd again.
Title: Re: what are the differences between install the extensions to RAM or mount them
Post by: beerstein on October 11, 2009, 12:51:03 PM
Can I install the extensions plus the system onto a hard drive or an USB stick?

I had TC running and installed some extensions ( 30 minutes) the when I switched off - all the extensions were gone. I would like to have either new Live CD with my extensions or the whole thing (system and extensions) in a file or even installed on hd.

I have learned some where in this forum that TC is not ment for hd installation - why

I love it

beerstein
Title: Re: what are the differences between install the extensions to RAM or mount them
Post by: bmarkus on October 11, 2009, 01:47:57 PM
Can I install the extensions plus the system onto a hard drive or an USB stick?

I had TC running and installed some extensions ( 30 minutes) the when I switched off - all the extensions were gone. I would like to have either new Live CD with my extensions or the whole thing (system and extensions) in a file or even installed on hd.

I have learned some where in this forum that TC is not ment for hd installation - why

I love it

beerstein

If you are using WINDOWS, download UNetbootin from http://unetbootin.sourceforge.net/ and install. Next format your stick for a usual FAT partition, than install the TC ISO image with UNetbootin.

Than create a /tce dir in the root of the stick where TC installed. /tce will be used by TC to store downloaded applications permanently.

When booting from the stick hit TAB to get to edit boot parameters and add to the end

tinycore waitusb=5

Other methode is to start TC from a CD and use its builtin usbinstall function. Creation of /tce and use of waitusb is the same as before.

Later when you are familiar with TC you can apply more advenced techniques but it is a good startup.





Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: Guy on October 12, 2009, 05:38:09 AM
Quote
Can I install the extensions plus the system onto a hard drive or an USB stick?
I have learned some where in this forum that TC is not ment for hd installation - why

It can be installed on both hard drives and usb drives.

Here is some info


Hard drive installation

http://www.tinycorelinux.com/install.html

[removed due to policy violation]/net-install.html

[removed due to policy violation]/install.html


USB installation

[removed due to policy violation]/install-usb.html



You can even make a cd with programs.

http://wiki.tinycorelinux.com/tiki-index.php?page=Integrating_extensions

[removed due to policy violation]/modified-cd.html
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: nickispeaki on October 13, 2009, 02:52:42 PM
Quote
Can I install the extensions plus the system onto a hard drive or an USB stick?
I have learned some where in this forum that TC is not ment for hd installation - why

[removed due to policy violation]/net-install.html

[removed due to policy violation]/install.html
[removed due to policy violation]/install-usb.html
[removed due to policy violation]/modified-cd.html

[removed due to policy violation] is dead!  :-[
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: Guy on October 14, 2009, 12:50:11 AM
Quote
[removed due to policy violation] is dead!

What do you mean by dead!
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: 4-stroke on October 14, 2009, 01:10:42 AM
Quote
[removed due to policy violation] is dead!

What do you mean by dead!

I can acess the page just fine. There's some great info there btw. ;D
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: mcewanw on November 08, 2009, 05:23:40 PM
I removed many tcz from my tce dir, rebooted and now I have a lot more free ram.
Looks like this mounted tcz uses a lot of ram

Then where is this memory used, if tcz is loop mounted from storage HD or USB . . . ?

No-one seems to have answered this question. Why do loop mounted tcz extensions use up so much RAM (even prior to actually running the applications in these mounted extensions)? Simply mounting a normal partition doesn't eat up RAM but loop mounting tcz extensions seems to.

For example, I notice how little RAM tinycore uses before any tcz extensions are loop mounted. But once you loop mount a browser and emelfm2 (along with all the dependencies), for example, the RAM used shoots up even prior to actually running any of these applications.
Title: Re: what are the differences between install the extensions to RAM or mount them
Post by: mcewanw on November 08, 2009, 06:16:40 PM
Using tinycore 2.5 on old Dell CPx laptop (Pentium III 500 MHz CPU with 256 MB RAM)

In an attempt to find an answer to the question in above post I tried the following:

1. Booted Tinycore 2.5 without any mounted tcz extensions and ran busybox free

It reported 32048 MB RAM used according to busybox free.

Following a tip I read somewhere from user Curaga, I then ran the command:

Code: [Select]
sync && echo 3 > /proc/sys/vm/drop_caches
a number of times in order to clear any caches being used by the virtual memory system.

That resulted in 30832 MB RAM now used.

2. I now rebooted but included (loop mounted) the bash.tcz extension.

Busybox free reported 33080 RAM used
and after clearing the caches (as above): 31504 MB RAM used.

I temporarily concluded that loop mounting a single tcz uses around 700 kB of RAM [31504 - 30832 (from step 1)].

3. As a check, I rebooted but now included: tcz extensions for bash, file, pppd and pppsetup (i.e. loop mounted four tcz extensions).

Running busybox free said: 35816 MB RAM used
After clearing the caches: 33640 MB RAM used

Hence difference between no loop mounted tcz extensions and using four loop mounted tcz extensions approximately = 33640 - 30832 (from test 1 above)
= 2808 MB (for these four loop mounts)

= roughly 700 kB per loop mount.

If the above is correct, it seems to me, that on low RAM machines (such as mine) it would be very beneficial to combine tcz extensions into one big extension in order to limit the number of loop mounts used. For example using fifty loop mounts would use up approx 35 MB of RAM (i.e. 50 x 700 kB), whereas if you combine all these into one big tcz before loop mounting you would just use up 700 kB of RAM to loop mount that single combined tcz extension.

It would be good, I feel therefore, if someone, who understands tcz squashed file systems, could write and provide a simple tool for combining them into one big tcz extension, which would allow the RAM savings indicated above on usage.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: gerald_clark on November 08, 2009, 09:33:15 PM
Loop mounted extensions have symlinks in /usr/local.  These symlinks still consume memory in the RAM based filesystem.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: Guy on November 08, 2009, 09:37:56 PM
Quote
It would be good, I feel therefore, if someone, who understands tcz squashed file systems, could write and provide a simple tool for combining them into one big tcz extension

I started a new subject for this.

http://forum.tinycorelinux.net/index.php?topic=3757.0
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: mcewanw on November 08, 2009, 11:04:00 PM
Loop mounted extensions have symlinks in /usr/local.  These symlinks still consume memory in the RAM based filesystem.

As far as I know, symlinks only occupy about 55 bytes each. A quick look at my /usr/local suggests to me that even the relatively large number of symlinks appearing there don't add up to anything like the RAM used by loop mounting a tcz. For example, I counted around 35 symlinks in my seamonkey browser directory, which would only account for around two kbytes of RAM use in total, unless I am missing something or other in all this.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: roberts on November 09, 2009, 12:52:49 AM
I would not be concerned as Phillip Lougher. the author, maintainer, copywrite holder, of squashfs has stated that squashfs uses its own cache and will release it when needed by low memory systems.

Additionally, Tiny Core provides other means to support very low memory systems, from PPI to traditional (scatter mode) installations.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: gerald_clark on November 09, 2009, 02:29:14 PM
Bytes used to store a symlink depend on the length of the path/filename stored.
This can be stored in the directory, inode, or file. if the name is too long to fit in the directory or inode, it must be stored in the first data block.
Title: Re: what are the differences between install the extensions to RAM or mount them?
Post by: ^thehatsrule^ on November 17, 2009, 07:09:21 PM
To be pedantic, more bytes are reserved due to block sizes afaik