How much RAM (totalled) am I using?


If anybody could tell me how to figure out how much (as a percentage) of my total RAM I'm using at any one time, as opposed to how much RAM each cryptically-named process in Process Viewer was using, I'd much appreciate it.
Well, just out of curiosity the other day, I added up all the percentages of memory used by the processes showing in Process viewer. The total came to about 126% :)

But you have to remember that Mach is running the memory show here. Every process under Mach is allocated 4 GigaBytes (yes, GigaBytes) of memory address space. If you have 20 processes running, that's 80 GB of memory! So how much total memory in use isn't really that important; Mach will page stuff out to disk to make room for stuff that needs to be running in RAM.

But if you really want to know how much physical RAM is in use, open a terminal window and type in 'Top' at the command prompt. This will run the Unix program Top, which will show statistics on the top processes. There's a bunch of memory-related stuff there, including page-ins, page-outs, wired memory (memory that can't be paged to disk), etc. I think the last line will give you the total RAM in use. On my machine, which has 256 Meg installed, I'm usually using about 253 Meg or so of that if I have a dozen applications open. I really haven't noticed much performance difference regardless of how many processes are running, even when Bryce is rendering Animations in the background in Classic, or the Classic version of Setiathome is processing work units in the background.

Apple wasn't kidding when they said "out of memory" messages are out of here. :)

You have to be careful when you say that "every process is allocated 4GB of memory". In a way, that's not really true.
Every process can use a maximum of 4GB of memory, but that isn't *allocated* per se. Memory is allocated dynamically by the OS at the request of the process. We want to make sure that folks don't think that 4GB is immediately sucked up by RAM and VM whenever you launch an app!

When you launch your app, only required chunks of the code are paged into the RAM. The app along the way requests more memory to go about its work, and the OS grants the memory, and the RAM the app uses grows dynamically. A well-written app can also release that memory back into the system when its through with it, which the OS is free to allocate to some other process.

When all RAM gets allocated (or a large part of it), the OS starts paging less recently used parts of that app or other apps to disk, to make room. You'll notice that if you have a lot of apps open, then go back to an application that is running, but you haven't used it in a while, you hear the disk moving as its getting paged from disk, and then some other app gets some paged from RAM to disk.

You are correct that "out of memory messages are outa here". The only thing you'll notice as your RAM fills up is increased time to launch apps and to switch apps.
Yes, you're right on the address space. This doesn't mean each app gets 4 Gig of continuous address space! If it did, you'd soon run out of disk space, let alone RAM. :)

But I have to say, even with 20 or 25 applications running (including things like Photoshop running in Classic), I rarely notice any lag in launching or switching apps (which might have something to do with an UltraSCSI disk slurping data off the drive at almost 30 Meg/sec). In fact, last night I had about 15 apps up, and launched another 7 more or less simultaneously while I worked on a foreground task, with almost no loss of responsiveness.
Wow, lucky you, Eric!

When my apps start swapping out, for example, I leave Mail running for a long time, when it gets swapped back in the disk on my beige G3 really starts chugging for quite a while.

But, I have the stock disk with only 128MB RAM on a beige G3...