Disabling Virtual Memory/Swapfile

thedbp

Frantic Messenger of Hope
So I've noticed that OS X, while it does do a great job of dynamically allocating RAM, isn't using my RAM to its full potential. A perfect example would be the fact that usually I have over half of my physical RAM completely unused (I have a GB) yet the OS is still thrashing my hard disk with pageins and pageouts.

WTF?

I was wondering if anyone knew if I set the swapfile to /dev/null if that would completely break my system or just disable VM. I don't really see the need to use my hard disk when I have literally over 550MB of RAM completely untouched. Is this a bug? Is apple trying to make my machine more like a Wintel box? I don't get it.

Any help would be great!

thedbp
 
I'm in the same boat buddy :) Sick of my machine swapping when there are 400+ MB of free RAM. Anyone know how to disable VM?

- T
 
I only have 384MB of RAM, and see very little paging activity. How many pageouts are you seeing in top (in the Terminal)? Maybe something to do with the apps you are running, some apps try to do their own 'paging'.
 
Here's a good example – this is the output from the top command i just ran. Just for background, I just booted this thing up (after having to boot back into 9 to watch a DVD, feh!) not 5 minutes ago. All the apps you see open are launched at startup so they'll just "be there" when I need them.


Processes: 48 total, 3 running, 45 sleeping... 147 threads 17:40:54
Load Avg: 2.25, 3.33, 3.30 CPU usage: 61.2% user, 24.5% sys, 14.4% idl
SharedLibs: num = 100, resident = 23.5M code, 1.71M data, 6.43M LinkEdit
MemRegions: num = 3394, resident = 82.5M + 10.9M private, 51.9M shared
PhysMem: 55.5M wired, 82.1M active, 173M inactive, 311M used, 713M free
VM: 2.74G + 47.4M 8603(0) pageins, 0(0) pageouts


As you can see, I have 713M free – and while I'm not pageing out at all, I'm still writing the data to disk quite a bit, and for no apparent reason, either. Is this a standard practice of Unix systems? Can it be defeated? I'm sure that the time and bus bandwidth its taking to handle the data and pass it on to the hard disk from RAM could be better put to use re-drawing all these whiz-bang GUI elements. Not that I don't love them, but if I have 713M of free RAM, I'd sort of expect the system to grab as much as is necessary to make things happen smoothly. Granted my 350 G3 isn't exactly top of the line anymore (and in all honestly, it never was) but for as much as RAM supposedly helps OS X run more smoothly ... I'm tempted to take it out in increments and measure the performance difference. That is, if Apple felt like paying me for R&D :).

thedbp
 
I'd just like to say how absolutely mind-bendingly cool it is to be involved in the (consumer) beginning of what X is now, and will be for some time to come: the most advanced OS EVER.  I feel great pity for the Winbloze fanbase simply because they're too utilitarian, to convenience-oriented. Yes, sometimes we have to jump through hoops as Apple aficianodos, and sometimes they can make it difficult for their customers – but the difference is, they're trying their hardest to be the best that they can. And it shows. No other computer product on the market comes close to the ingenuity, beauty, functionality, and ease of use of Apple's products. Yeah, we gotta spend more. Yeah, we gotta deal with what has traditionally been a dearth of software. Yeah, they've changed chip architechtures and OS architectures dramatically over their history, making a lot of enemies in the process. But all of it was done because they wanted to put forth the best product they possibly could. They aren't afraid to alienate even their own customers, because enough people will always recognize that what they're doing is peerless. It always has been, and always will be.

Suck on that, Mike Dell.

Thanks, Apple.
 
Originally posted by thedbp
PhysMem: 55.5M wired, 82.1M active, 173M inactive, 311M used, 713M free
VM: 2.74G + 47.4M 8603(0) pageins, 0(0) pageouts


As you can see, I have 713M free - and while I'm not pageing out at all, I'm still writing the data to disk quite a bit, and for no apparent reason, either. Is this a standard practice of Unix


With 0 pageouts, the virtual memory system isn't doing any writing to disk. It would be your applications opening or initializing work files.

The disk activity you note could be reading (pageins). If your applications execute bits of themselves from here and there around the program, they could be triggering loading of code from widely spaced areas of the program at startup. And then, as you use them, they may need to swap in other pieces of code that weren't yet loaded into memory.

With zero pageouts, your large physical memory is working, and what you're seeing isn't virtual memory thrashing. It has something to do with the way your applications work in the OS X environment.
 
hmmmm guess i jumped the gun on that one, thanks for the info. I have seen some pageouts here and there, but no more than 350 - 400 total after a couple days use. I guess I just expected 10.1 to be faster with a GB of ram.

how many people think that X will continue to get faster for a little while?
 
Back
Top