Google
 

Digg Links

Wednesday, May 30, 2007

Speeding up computer; dropping swap.

As I've written in few posts before, I use IBM Thinkpad T42 for my day to day work. The "forced" operating systems installed is Windows XP Service Pack 2. Unfortunately, the laptop has only 512M of memory, and this often leads to a large "swapping" exercises. We used to "swapping" almost since first hard drives appeared (IBM Winchester was my first one), and we all know how and when it happens.

But this is exactly the problem I'm having - all I do is read email, browse the web, and create documents; sometimes I happen to watch a short movie (or YouTube clip) or listen to music - hardly the most intensive stuff in computing. But it really bugs me to wait for any application to load. Sometimes an applications such as Firefox or Outlook take upto half a minute just to start! And that's on almost idle system where one or two lite (such as PuTTY or IM) applications are running. This is very irritating, and bugs me more as a current state of things in all systems and in all applications rather than waiting itself.

I'm sure that this behavior while better in other operating systems, is similar in all of them.

So this got me thinking. Today's memory is cheap. Today's system are fully capable of handling 4GB of memory. What if I were creating "virtual" volume in memory and mount swap space in it? After all, I use swap for swapping only when system is up. I don't need it when system is off.

So, I'd equip my system with 4GB memory, giving 2GB of it to the OS, and using the other 2GB as swap space. The intention being eliminating hard drive access as much as possible. Would that work? Would this speed up my system?

Tell me what you think.

-A.

Technorati : , , , ,

6 comments:

Anonymous said...

That does not make sense to me as Linux only swaps if memory is full. By allocating swap memory in RAM you just fill it and force the system to swap...

tante said...

Stargazer is right on this one: Making Swap in RAM does not make sense.

What you could do is have you programs "preloaded". Linux caches which stuff was read (that's why a warm start of firefox is faster than a cold start). If you would force the system in your local.start to read all the files you'll be needing it might speed things up (but you pay with longer loading times).

The idea is to get as much as possible into the cache RAM.

Alex said...

OK, I got what you guys are saying, but it is not what I meant.

I meant making a system to "know" it only has 2 gigs of RAM, and the other 2gigs it will "see" as, say, another partition. From its point of view, its like working normally, just swapping will be much faster.

Just think about it like "external" memory which I mount as partition.

It is just a thought. While Linux may not swap all the time, I still suffer from long waits a lot.

I don't want to.

tante said...

You could of course create a ramdisk there that you do shuffle your programs over to while starting the computer (so they are read from RAM) but I don't think that that extra layer will be faster than just relying on linux's internal caching.

I'm not sure how windows is in that aspect though.

Anonymous said...

Check that your HDD is using DMA. Windows is happy to stop using it when it experiences few "access problem" - which might be triggered by just delay of HDD spin-up when resuming from suspend.
Also, Windows happily swaps programs from memory to HDD when the RAM is occupied by file buffers... complete nonsense and Linux doesn't do that.
Anyway swap in RAM makes no sense :) And 2GB RAM should be enough even for Windows...

Unknown said...

Oh my god :-D.

Swap is used, because there is no memory. So swapping to memory is complete nonsense. You will swap into memory because you don't have enough memory ? Do you see the loophole ?