Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: Ulysses_ on April 17, 2011, 06:09:15 PM

Title: Handle large files by utilising the swap space?
Post by: Ulysses_ on April 17, 2011, 06:09:15 PM
Read somewhere that when tmpfs runs out of memory it can utilize the swap space.  TC seems to be using tmpfs but only files smaller than the free memory can be handled.

Is there a way to extend TC's filesystem so it can hold large files temporarily by utilising the swap space?
Title: Re: Handle large files by utilising the swap space?
Post by: tinypoodle on April 17, 2011, 07:26:53 PM
tmpfs mounted over / in TC by default amounts to 90% of available RAM.

When a lot of RAM is needed to be used by apps, then files stored in tmpfs would get swapped out to disk, I have observed such on several occasions.
Title: Re: Handle large files by utilising the swap space?
Post by: Ulysses_ on April 17, 2011, 08:01:17 PM
What about when you want more space for files and not more memory for applications?  Can't I modify that 90% default?
Title: Re: Handle large files by utilising the swap space?
Post by: danielibarnes on April 18, 2011, 12:04:48 AM
Can't I modify that 90% default?

You can change the size at any time (http://en.wikipedia.org/wiki/Tmpfs#Linux) with:

mount -o remount,size=95% /
or
mount -o remount,size=3G /
Title: Re: Handle large files by utilising the swap space?
Post by: Ulysses_ on April 18, 2011, 07:23:07 AM
That's great. It has applications in virtualization. It can make a VM's swap space almost as fast as RAM.

Until there is no more RAM left and the VM's swap space gets as fast as the host's swap space.

[ By setting the swap space as a separate .vmdk that is non-persistent and has its REDO file in /home/tc/<VM-specific-directory> ]