General Question

rexpresso's avatar

What is Virtual Memory and why is it so high? (Mac)

Asked by rexpresso (922points) September 12th, 2010

Please have a look at this image. I don’t understand. Is this huge use of virtual memory having an effect of slowing down my machine? What is it about really? Thanks!

http://img.skitch.com/20100912-jh8y87d9pycc6k8i7589ttbakb.png

Observing members: 0 Composing members: 0

6 Answers

timtrueman's avatar

Virtual memory is an abstraction that decouples memory used by programs from the physical hardware. Basically it makes it possible for a computer without enough RAM to still run all the programs a user might run simultaneously.

How it works is the program is given a block of virtual memory that may sound obscenely large and the program may or may not use all of that memory. What happens is if there isn’t enough physical RAM available the operating system will swap out some of the data currently unused that is stored in RAM and copy it to the disk. This is called paging (data is stored in pages in RAM).

Page ins aren’t a big deal but page outs areā€”page outs means you don’t have enough RAM for all the programs you’re currently running so it had to write out some pages to disk in order to make room for another program. When the other program goes to use a page that’s been written to disk it has to go and get that page and then that page is brought back into memory. Sometimes this can lead to “thrashing” where the same pages and written in and out over and over. That would definitely make things slow. You have three real options:

    1. Run fewer programs
    2. Buy more RAM
    3. Get a faster disk so page outs are fast (i.e. get a solid-state drive)

I’d recommend all three options (in combination). Just for reference memory is a few orders of magnitude faster than disk drives so more RAM (or minimizing your usage of RAM) can make a huge difference.

Summary: huge virtual memory numbers aren’t a problem at all but paging to disk is an issue.

Ben_Dover's avatar

Buy more RAM…You should have at least a gigabyte of RAM. It is easy to install on most laptops, too.

rexpresso's avatar

Yeah I’ve researched and I can still upgrade my 2007 Macbook from 2 to 3 GB and it’s supposed to make a significant difference. It’s cheap enough so I think I’ll go and buy it today.

As for using SSD for paging, well, that reminds me of something that I think was in Windows Vista, that one could use USB flash drives to increase the system performance. Is that worth looking into?

FYI the biggest culprit of my ongoing system slowdowns and almost-eternal hangs (sometimes), I believe is my browsing. Sometimes I have four different browsers open, with tens of tabs in each. If you have any practical solution to improve my performance given this disclosure… :)

Cheers!

sandalman's avatar

Don’t bother. The performance gain is miniscule; it’s far better for you to spend on the RAM, or the SSD for that matter.

camertron's avatar

The great thing about an SSD is that it’s like having essentially an entire 256GB (or however large the drive is) of RAM at your disposal because the drive is so fast compared to the magnetic spinning drives of today. Personally I’d wait for SSDs to come down in price before I bought one to speed up your Macbook. Thrashing is the only real danger you face when using virtual memory because at that point you don’t have enough disk space AND you don’t have enough RAM. Bad news. Using virtual memory in general won’t slow down your computer that much, so if you aren’t noticing a significant slow-down chances are everything’s peachy keen. If you hear your laptop making lots of noise (whirring and muttering a lot) when performing routine tasks, that indicates heavy disk use and is probably cause for concern. If not, you’ll be fine and won’t need to worry about SSDs. It’s always nice to be able to equip your computer with more RAM though, so like the others in this discussion I’d recommend installing more RAM no matter what.

rexpresso's avatar

I’m leaving right now to buy RAM, I am a heavy web browser and sometimes the computer begins thrashing and it is so frustrating. I’m putting an end to it :)

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther