Ups and downs of a swap file?


Blue Protoman

Well-Known Member
Joined
Mar 6, 2010
Messages
4,117
Title. I know that swap files allow one to make up for RAM shortages. Are there any other blessings and curses (especially in relation to the media)? Anything I should do or not do? I do have some spare SD cards.
 
Title. I know that swap files allow one to make up for RAM shortages. Are there any other blessings and curses (especially in relation to the media)? Anything I should do or not do? I do have some spare SD cards.

the big downside is the constant writing which will wear out the card over time.
 
Title. I know that swap files allow one to make up for RAM shortages. Are there any other blessings and curses (especially in relation to the media)? Anything I should do or not do? I do have some spare SD cards.

the big downside is the constant writing which will wear out the card over time.

That's why I bought a dirt-cheap 1gb MicroSD that's going to be used for nothing else. :)
 
the big downside is the constant writing which will wear out the card over time.
I'm pretty sure the more immediate issue would be noticeable slowdowns as things are swapped in and out of memory constantly. Something like Firefox, where it swaps out a page and leaves it there until you want to view it again should be no problem, but if you run a program that actually needs even a couple megs of beyond available physical RAM that gets swapped in and out every second or so, you will notice slow downs.
 
What programs do people here typically use swap files for, anyway? I don't use Firefox, I use either Lightweight2 or Midori.


And also, what programs push the RAM to the limit? If the DSP's gonna take up a chunk of the RAM, then some things might need a swap file in the near future.
 
Last edited by a moderator:
What is a 'swap file'?


Maybe you mean swap-partition?


Linux uses this to write the memory to disk. So it can be used for basically anything.
 
And also, what programs push the RAM to the limit? If the DSP's gonna take up a chunk of the RAM, then some things might need a swap file in the near future.
I was running Midori with 2 tabs open, an audio player (I think it was Exaile, but pretty much any could apply), running SNES, with a fairly large PDF (or did I have two open?) displayed, and (attempting, it was really slow by this point) to play Big Buck Bunny in VLC, and I still had about 20MB of free RAM.


Outside of opening a bunch of tabs in a web browser, there isn't really a lot pushing the boundaries of RAM at the moment.


I suspect Mupen is one of the closest to filling it out, but I can't figure out how to get back to a desktop and test that while it's running.


Having a swapfile with swappiness of -1 is probably not a terrible idea: it'll sit there unused at worst, and in the unfortunate event of needing more RAM than is available, it'll kick in to help. On the other hand, by providing swap, it can mask a problem in the way your system is running: you might find one day that your Pandora is running kinda slow and have no idea why, unaware that some process has gone and sucked up 400MB of RAM for some stupid reason.


So maybe a trade off: just 64 or 128MB of swap against the Pandora's 256MB physical RAM; that way if you are running a bunch of stuff and butt up against the extents of RAM, you have an emergency buffer, but at the same time it isn't so large that some crazy process can run away with huge amounts of RAM and leave you with a slow system.
 
So maybe a trade off: just 64 or 128MB of swap against the Pandora's 256MB physical RAM; that way if you are running a bunch of stuff and butt up against the extents of RAM, you have an emergency buffer, but at the same time it isn't so large that some crazy process can run away with huge amounts of RAM and leave you with a slow system.

Um, just because I have a 960mb swapfile doesn't mean it's all going to be used right? I really only expected a few MB to be used most of the time if it was needed... but for the price of a 1GB compared to anything smaller... it seemed pointless buying a smaller card. I had intended to plug it in and activate it only when (in the future) I do some intensive browsing sessions, listening to music and possible image editing at the same time... and I heard the larger maps in Battle for Wesnoth could do with some swap to *prevent* slow downs...


When I was done, I would deactivate the swapfile and unplug the MicroSD.


No harm surely? Especially as the swappiness is set to -1 ...
 
Um, just because I have a 960mb swapfile doesn't mean it's all going to be used right?
No, I was talking in the theoretical scenario where a single process does decide it needs to use 400MB of RAM for some reason, and spends half the time swapping. There's very little cause for a process on the Pandora to use that much memory, so it's probably a sign that something is actually wrong. On the other other hand, that's probably such a rare event that it isn't worth worrying over.
 
Back
Top