WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: The swap partition  (Read 4574 times)

Offline meo

  • Hero Member
  • *****
  • Posts: 651
The swap partition
« on: October 04, 2009, 05:25:12 AM »
Hi Robert!

First I want to congratulate the tinycore team for the new cut of TC. There is a question that has been in my mind for sometime. As you can see from the title it concerns the swap partition. I have a 2 GB swap partition but according to the watcher extension this partition is hardly ever used. Since I only have 256 MB of RAM memory it makes it impossible to download bigger files. Usually after downloading around 150 MB the OS stops the download and says that there is no more memory. When that occurs only less than 5 % of the swap partition has been used. Is there a way to make tinycore to make more use of the swap partition? Would it be better to have a "swapfile" instead of a swap partition? I would be most grateful for any comments on this subject.

Have fun Y'all with tinycore,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: The swap partition
« Reply #1 on: October 04, 2009, 06:24:55 AM »
Unused apps and files should go to swap, but since the file you're currently downloading is active, it can't be swapped.

You can tune the swapping a little, though it won't help with this problem:
http://kerneltrap.org/node/3000

Since the swap is hardly used, why not make it 1gb, and use the remaining 1gb for downloading?

Re swap file - a partition is better.
The only barriers that can stop you are the ones you create yourself.

Offline meo

  • Hero Member
  • *****
  • Posts: 651
Re: The swap partition
« Reply #2 on: October 04, 2009, 11:08:47 AM »
Hi curaga!

Thank you for posting this. The reason for the fairly big swap partition is that with DSL i used to do much remastering and that demanded a big swap partition to work. I also have for example ubuntu installed so I havent changed the size of the swap partition. I have a lot of harddisk space although the motherboard on my old laptop normally doesn't support more than a 32 GB harddisk, I have installed a 100 GB harddisk. So I had to trick the BIOS to believe that I only have a 30 GB harddisk. My laptop is limited to handle 256 MB of RAM so there is the problem. I have a 12-boot system on my laptop (12 different choises of which OS to boot) so I have to take all of them into consideration. When I use tinycore it is in a frugal mode so the RAM and the SWAP are the memories that can be used. Therefore I posted my question. It's really just a matter of not having to change from tinycore to another OS just to download bigger files. Thanks again!

Have fun making tinycore reach "higher altitudes",
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: The swap partition
« Reply #3 on: October 05, 2009, 11:42:16 AM »
Quote
Since I only have 256 MB of RAM memory it makes it impossible to download bigger files.  Usually after downloading around 150 MB the OS stops the download and says that there is no more memory.
Depending on what you're downloading, you should be able to download large files regardless of how much ram you have...as long as your disk is large enough to store the file.  If the file is being downloaded completely to a cache (browser cache, for example) before being transferred to a permanent location, I think there's something wrong with the way that application works and I'd recommend trying something like wget or ftp to do your downloads.  An alternative is to move your browser cache to disk and link to it from the original location in ramdisk.  If you're saving the file to your home directory, I think you're needlessly using up your ram; try saving the file to disk instead.

One frustrating thing I've seen recently is trying to view large flv video files online.  Sometimes the files are transferred from cache to /tmp after the download reaches a certain size, which sucks up ram even when cache is on a harddisk.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: The swap partition
« Reply #4 on: October 05, 2009, 11:55:09 AM »
So true. Just try an ls -lSr on your browser cache directory, it can be downright ghaslty.
10+ Years Contributing to Linux Open Source Projects.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: The swap partition
« Reply #5 on: October 05, 2009, 01:35:49 PM »
One frustrating thing I've seen recently is trying to view large flv video files online.  Sometimes the files are transferred from cache to /tmp after the download reaches a certain size, which sucks up ram even when cache is on a harddisk.

Mine bypasses cache altogether (it's set for 50 mg)  and immediately downloads to /tmp. In this example, I just cleared the cashe in Firefox and loaded a flv :  
Code: [Select]
tc@box:/tmp$ du -h Flash0NxcDk
6.1M    Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
8.2M    Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
9.8M    Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
18M     Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
28M     Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
36M     Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk
37M     Flash0NxcDk
tc@box:/tmp$ du -h Flash0NxcDk

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: The swap partition
« Reply #6 on: October 05, 2009, 02:53:51 PM »
It seems the flash video does get saved to cache, but it get's copied to /tmp while playing and is deleted when you leave the page.  At least with Shiretoko.

/tmp does not grow and grow as a result, but I do wonder why it is copied to /tmp during play.




Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: The swap partition
« Reply #7 on: October 05, 2009, 03:42:22 PM »
It seems the flash video does get saved to cache, but it get's copied to /tmp while playing and is deleted when you leave the page.  At least with Shiretoko.

/tmp does not grow and grow as a result, but I do wonder why it is copied to /tmp during play.

You're right....it's both are involved; (both get deleted as well)
Code: [Select]
tc@box:/mnt/hda3/firefox1/.mozilla/firefox/n4mhwpol.default$ du -h Cache/
10M     Cache/
tc@box:/mnt/hda3/firefox1/.mozilla/firefox/n4mhwpol.default$ du -h Cache/
13M     Cache/
tc@box:/mnt/hda3/firefox1/.mozilla/firefox/n4mhwpol.default$ du -h Cache/
15M     Cache/

Code: [Select]
tc@box:/tmp$ du -h FlashU1FMEp
12M     FlashU1FMEp
tc@box:/tmp$ du -h FlashU1FMEp
14M     FlashU1FMEp
tc@box:/tmp$ du -h FlashU1FMEp
15M     FlashU1FMEp

edit: Another reason to link the .mozilla file
« Last Edit: October 05, 2009, 04:06:38 PM by jpeters »

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: The swap partition
« Reply #8 on: October 05, 2009, 07:53:17 PM »
....edit: Another reason to link the .mozilla file
how to link?
dCore user

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: The swap partition
« Reply #9 on: October 05, 2009, 08:48:44 PM »
My firefox cache is set to 500mb, since I have a persistent home and I was hoping /tmp wouldn't be used.  But as Jason and jpeters said, that doesn't keep flash from storing the file in /tmp.  I've actually started using /tmp as a source for saving flash-based video files rather than using the DownloadHelper firefox extension, since it is more consistent.  It asks the question, though, of why Flash is still the prefered method of delivering online video.  Not only is Flash very heavy on the processor, but it apparently uses up to twice as much temp space as it really needs.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: The swap partition
« Reply #10 on: October 05, 2009, 09:23:48 PM »
....edit: Another reason to link the .mozilla file
how to link?

I symlink all memory intensive config files in $HOME to my HD so that it boots faster (and doesn't consume ram. Firefox looks for .mozilla in the home directory, so I copied it to /mnt/hda3/firefox  and then 'ln -s /mnt/hda3/firefox/.mozilla  $HOME'     
« Last Edit: October 05, 2009, 09:26:28 PM by jpeters »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: The swap partition
« Reply #11 on: October 05, 2009, 09:35:49 PM »
My firefox cache is set to 500mb, since I have a persistent home and I was hoping /tmp wouldn't be used.  But as Jason and jpeters said, that doesn't keep flash from storing the file in /tmp.  I've actually started using /tmp as a source for saving flash-based video files rather than using the DownloadHelper firefox extension, since it is more consistent.  It asks the question, though, of why Flash is still the prefered method of delivering online video.  Not only is Flash very heavy on the processor, but it apparently uses up to twice as much temp space as it really needs.

I have FF on (non-ram) /mnt/hda3, but still give cache only 50mb*.  I've never noticed any problems at all...probably just stores less links, which is fine with me.  Whatever the reason, Flash is moving to iphones, etc, so it must have some advantage to $$-advertisors-$$  ((Sorry....getting off topic))
(*note: even then,  FF still uses 216mb. Links uses 8.6  :)

« Last Edit: October 05, 2009, 09:50:03 PM by jpeters »

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: The swap partition
« Reply #12 on: October 06, 2009, 05:36:34 AM »
Meo, which program are you using for downloads?

I use wget, and download large files, such as entire cds - 700mb.

I have 512 mb of ram in this computer.


Create a directory for downloads, not in /home/tc so it is not in backup. For example, you could use /home/downloads (if you are not using encrypted home). It needs the owner tc and group staff, so you don't need to run wget as root. You can create it in /home/tc, and cut and paste it somewhere else, or create it somewhere else and change owner and group.

To start or resume a download, open the terminal and type:

cd /home/downloads
wget -c url

for example

cd /home/downloads
wget -c http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release_candidates/tinycore_2.4rc4.iso

To stop or pause, press ctrl+c
Many people see what is. Some people see what can be, and make a difference.