Is your OSX paging file feeling a bit bloated these days?

Posted:
in macOS edited January 2014
Mines runs somewhere between 4-6 GB of disk space. This just seems insane to me. What in the ghastly world is it storing in all that space? Why doesn't it purge eventually if you let it sit for a while? I quit some apps that had the largest VM allocations (don't wanna name names, but it starts with Safari ). That made a big difference in clearing out some VM bloat, however it still never dropped below 4 GB. That's a whole lot of crap just sitting there. I know if I was running a Win2k machine such that the VM file had to grow to that size, it would have keeled over long before that.



After quitting (actually restarting) a few apps, the only the process running a huge VM heap is the kernel task (600+ MB ?!?!). I'm guessing that trying to quit that would be a bad idea? So is there a way to purge/freshen that process (w/o rebooting) to get rid of all the VM junk after a long uptime? I'm just curious, as I'm sure it doesn't really matter, but I like to keep a "clean" house.



Most of all, doesn't it strike anyone as peculiar that the VM accumulates such bloat? Wouldn't it be more "proper" to have a more aggressive dispatching scheme to throw out a few GB's or so of useless scratch data? I mean seriously- after stopping Classic, the TruBlue process released some 1 GB of VM. I hadn't done jack in Classic. It's just been sitting there idle for days. Now I could understand if you are running some gigantic process with a huge database, but I'm just running little, general purpose home user apps.



Why does Netscape only use about 60 MB of memory (the way I use it) in OS 9.1, while Safari takes up a whopping 125 MB of real memory PLUS 230 MB of VM to accomplish the same thing? Why do even the simplest apps these days easily take 100+ MB of total memory to run in OSX? I look at my Activity Monitor, and it's literally every other process is grabbing 100+ MB of VM. For what, I ask?!



...and let's not even get started on the hard disk footprint for OSX! I remember scoffing at the notion that a Win2k installation took up 1 GB of space. Now we have OSX taking something like 3 GB of space with all those library folders?! Now that is a FAT, FAT OS, imo. That's still not including my typical 6 GB paging file size. Together it is nearly 10 GB of OS stuff-the size of an entire oem HD not too long ago.



Obviously, this is a rant, but also I'm expressing my curiosity as to why things are so gigantic these days? I'm not really complaining about performance, as with all of the above conditions, I am running smooth with no signs of insufficient memory. It just seems like there is a great sense of severe gluttony as our beloved OS matures. Can we expect some future incarnation of a Stickies app swallowing up 1 GB of memory just to put simple yellow boxes on my desktop? What's going on here??? Shouldn't there be a concern among developers to keep things somewhat "slim" wherever possible with only moderate code growth to encompass added modern functionality? Holla!
«1

Comments

  • Reply 1 of 37
    chuckerchucker Posts: 5,089member
    According to memory cell, Safari is currently taking up 28.3 Megs of RAM for me.
  • Reply 2 of 37
    kickahakickaha Posts: 8,760member
    Basic rule of software design: you can have it fast, or you can have it small.



    People want fast, and scarfing up memory for caching is an easy way to help that. Pages get cached, undo stacks, you name it.



    Also, much of that memory is being shared between apps invisibly behind the scenes, particularly for things like the Cocoa or Carbon libraries, so it looks like you're using much more memory than you really are.



    Of course, OTOH, you'll have memory mapped files that can be either cached to RAM for speed or mapped to disk for deferred access...
  • Reply 3 of 37
    randycat99randycat99 Posts: 1,919member
    C'mon, I can understand some caching to make things a bit bigger, but it seems like things have gone to an extreme. If Safari is storing 200 MB of past webpages in VM (as an example), isn't that kind of a wasteful use of resources? My dialup connection couldn't even download that much going full tilt for 12 hrs, so wouldn't this be caching taken to a ridiculous extreme?



    I have 3 small sticky notes on my desktop that haven't changed for months, so what in the world could it be caching in 100 MB of VM? Do you see what I'm getting at now?



    I see your point about Carbon and Cocoa libraries, though. Does this mean that if I add up the real memory values of all my processes, it wouldn't add up to my "memory used" readout (due to the libraries being "counted" multiple times). How much do you think it accounts for your typical app? 20-30 MB?



    What's "memory cell", btw?
  • Reply 4 of 37
    Unfortunately (or perhaps, fortuneately), the hardware is just starting to get to the point where OS-X can really show it's potential.



    The OS was designed when the current hardware could just barely handle it... hardware is just barely catching up to it, even now. It was truely the OS of the future.



    There was a time when we were all slack-jawed (well, those of us who weren't in diapers were) when they came out with HardDisk drives that held 20MB of data ... "my god, what could possibly need that much storage space!!!" ... this was when our OS fit entirely on an 800k floppy disk

    Now we have 200GB+ drives.



    Soon (years?), memory will not matter ... we will have machines with cheap memory approaching (or exceeding) the terrabyte realm. Page-outs will be a thing of the past, and you'll laugh at yourself for ever starting this thread.

  • Reply 5 of 37
    randycat99randycat99 Posts: 1,919member
    That's another thing that irks me- my iBook came with a nice, roomy 60 GB HD (biggest I've ever had, so it seems huge to me). I thought it would be a looooong time before I need to worry ab out storage space. I haven't even done any serious work on it, yet, and it is already half way full! For the life of me, I have no idea what all is making up 30 GB, because I sure don't have that much in personal files. Had my iBook come with a standard 30 GB, I don't know what I would do. To be fair, I do know that there are 3 apps on there that take up some serious space- Garage Band, Tony Hawk, and AvP2. GB has like 1.8 GB of files in application support (which seriously contributes to the aforementioned OS folder bloat), while the latter 2 take up just over 1 GB each.



    It just seems like everything is burning "space" like it is going out of style.



    I don't know if it really matters much to me if in the future it is all in RAM vs VM. I'll still be astounded at what in the world could be using all that space. I just don't see how something that is only called upon to show a page of text and some 2D graphics (as an example) can balloon out to needing 100's of MB. Something is just not adding up here, imo.
  • Reply 6 of 37
    there is an add on for safari ( safari enhancer) which stops it cache ing pages. ive been running it for a week, seems to work fine
  • Reply 7 of 37
    randycat99randycat99 Posts: 1,919member
    Quote:

    Originally posted by gashlight

    there is an add on for safari ( safari enhancer) which stops it cache ing pages. ive been running it for a week, seems to work fine



    Now why would I want to do that? I wouldn't want to shut it completely up. I just don't want it to cache "half" the Internet in there. If memory serves (no pun intended), I believe it was holding like 600 MB in VM last time before I quit and restarted the app.
  • Reply 8 of 37
    jabohnjabohn Posts: 525member
    Quote:

    Originally posted by Randycat99

    That's another thing that irks me- my iBook came with a nice, roomy 60 GB HD (biggest I've ever had, so it seems huge to me). I thought it would be a looooong time before I need to worry ab out storage space. I haven't even done any serious work on it, yet, and it is already half way full! For the life of me, I have no idea what all is making up 30 GB, because I sure don't have that much in personal files. Had my iBook come with a standard 30 GB, I don't know what I would do. To be fair, I do know that there are 3 apps on there that take up some serious space- Garage Band, Tony Hawk, and AvP2. GB has like 1.8 GB of files in application support (which seriously contributes to the aforementioned OS folder bloat), while the latter 2 take up just over 1 GB each.



    It just seems like everything is burning "space" like it is going out of style.



    I don't know if it really matters much to me if in the future it is all in RAM vs VM. I'll still be astounded at what in the world could be using all that space. I just don't see how something that is only called upon to show a page of text and some 2D graphics (as an example) can balloon out to needing 100's of MB. Something is just not adding up here, imo.




    Try OmniDiskSweeper to see what's all taking up the space on your hard drive. You can delete stuff directly from the program. Once, I found a folder taking up a couple of gigs that I didn't even know was there (downloads from a P2P program.)



    There's also a program to delete the extra language packs in the OS if you'll never need them, I think it's called DeLocalizer.
  • Reply 9 of 37
    Well the thing that annoys me the most is when the memory taken up by the applications + system starts to overwrite my preferences. I'm running slim under 1 GB of free space on startup! Shutdown is a disgrace 32mg? And a wopping big 640mb of ram, where the hell did the 640 megs of ram go? And memory leaks are a pain in the but when your computer is suffocating and deprived of hd space. I know I should clean up my mac, but the system or apps have a serious memory management problem if at least the 640mgs of ram isn't sufficient, and then go all the way and screw my hard drive.



    It doesn't matter now, cause I've got an iBook with a 60 GB hard drive :P
  • Reply 10 of 37
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by Louis Klaassen

    the system or apps have a serious memory management problem if at least the 640mgs of ram isn't sufficient



    No they don't. If anything, they have a serious performance advantage. The huge RAM use of OS X is *by design*.
  • Reply 11 of 37
    wrong robotwrong robot Posts: 3,907member
    I emptied the trash today....10GB





    that is all.
  • Reply 12 of 37
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by Louis Klaassen

    Well the thing that annoys me the most is when the memory taken up by the applications + system starts to overwrite my preferences. I'm running slim under 1 GB of free space on startup!



    Your preferences aren't getting overwritten... they're just not getting written. Why? The apps don't have enough space left to write to... but don't have enough swap space left to make room by letting one of them quit elegantly. Catch-22.



    Try keeping at least 2GB free at all times for swap space.
  • Reply 13 of 37
    Oh ok, but it's kinda weird - it managed to load them but not save them. Then why do they revert to default instead of the last saved version? Like if your working on a doc and the power fails, dang you haven't saved. You don't loose the whole doc you just loose what you did since the last save. Unless you've started a new doc and haven't saved yet at all.
  • Reply 14 of 37
    sroachsroach Posts: 105member
    Quote:

    Originally posted by jabohn

    There's also a program to delete the extra language packs in the OS if you'll never need them, I think it's called DeLocalizer.



    Macaroni works well for that, and it's dirt cheap



    Find it here
  • Reply 15 of 37
    sroachsroach Posts: 105member
    Quote:

    Originally posted by jabohn

    Try OmniDiskSweeper to see what's all taking up the space on your hard drive. You can delete stuff directly from the program. Once, I found a folder taking up a couple of gigs that I didn't even know was there (downloads from a P2P program.)





    You can user the finder to find files by size: Here is an example, searching for all files larger then 25 Megs



  • Reply 16 of 37
    kickahakickaha Posts: 8,760member
    Add the 'Kind is folder' to find out where the hidden consumers are - those folders that have a couple thousand smaller files. Printer drivers come to mind...
  • Reply 17 of 37
    mmmpiemmmpie Posts: 628member
    I looked at the vm usage reported by the process tool a few weeks ago and thought, WHAT THE !?!



    How the hell can I be using 6gb of swap, even after a reboot Im using 4gb.



    I let it stew for a while.



    You know, on my PC running XP if I get over a gig of swap my machine crawls, terrible. Mostly SQL servers fault.



    I looked again, even really small apps are using over 100mb of vm. There isnt a gui app in that list that isnt using at least 100mb of vm. The background apps are using less.



    Then I realised, thats not swap space that it is reporting, it is vm space. Most of that vm space should be shared libraries, and they should only get swapped once.



    The imac I have in front of me ( blueberry ) has 1.3gig of VM, but, appropriately, its swap files are only 240mb.



    The numbers that you see in windows are page file size, OS X doesnt show you that. If you want to see how much space you are using open terminal and cd to /private/var/vm and do an ls -al

    Each swap file is about 80mb.
  • Reply 18 of 37
    randycat99randycat99 Posts: 1,919member
    Well, now I'm thoroughly confused by what is "swap", what is "page", and what is "vm". Normally, I would lump them all into one coarse category, but I'm guessing now there are subtle distinctions which defy them from being properly lumped together?



    Ironically, that Omnisweeper came in handy wrt peeking out the sizes of all sorts of "hidden stuff". I had happened earlier upon that vm area directory you describe. At the time I was "ranting", I saw 3 vm files that were oddly sized in multiples to each other. There was a 128, 256, and 512, iirc (since reboot, I see a 64/64/128, right now). As usual, things like this seem to only raise more questions rather than answer them. Like why more than one file? Why not one big file? Why no gigantic 6 GB file, as the impression was given to me from the Activity Monitor? If no 6 GB file, what in the world is that "6 GB" representing then? What is the importance of showing this in lieu of the actual VM useage (which seemingly great pains are being taken to hide this from the user)? Why hide this, in the first place? It would seem to be just as useful information as it is to indicate how much "real memory" we are using. Does "real memory" really mean what we think it means, then? Could "real" be another way to express physical memory + virtual memory (the typical kind we have come to know)?



    Like I said earlier, I'm confused!
  • Reply 19 of 37
    kickahakickaha Posts: 8,760member
    VM is virtual memory. It's the system that handles all the pages, the swaps, the caching, the file mapping, etc, etc. It's like a memory OS.



    When an application requests memory that the system doesn't have RAM for, it takes 'pages' of RAM (just a clever name for 'chunks') that haven't been used in a while, and moves them to the disk (or 'swaps' them) so there's room for the new application's request.



    When the old application is selected again, and needs that info, it repeats the process, selecting memory that hasn't been used in a while, and puts *that* on disk, and moves the old memory back in. This is going on *all the time*.



    Now, some clever soul figured out that you could take commonly used but seldom accessed system files (like shared libraries) and simply map them to memory space *without actually loading them off disk*. These are 'mapped files'.



    What all this means is: if your app is said to be using say 100MB of VM, 80MB may actually just be mapped files, leaving only 20MB of actual use... of which 19.9MB may be on the disk, and only 100kB in memory. You have to look at how much swap space is actually being consumed, versus mapped files, and such.



    The file sizes are an implementation efficiency trick - start with a base amount, say 64MB. If that fills up, assume you need double that amount again, so 128MB. If *that* fills up, make a new file of double *that*, and so on. That way you don't exceedingly over-allocate, but don't end up under-allocating and having to keep allocating repeatedly. It's a surprisingly good balance. Multiple files are used for disk access efficiency.



    Bottom line? Don't frickin' worry about it, it works, it works well, and it's very efficient.



    Just don't drop below about a Gig of free disk space.
  • Reply 20 of 37
    randycat99randycat99 Posts: 1,919member
    OK, good explanation. Thanks!



    So does that then suggest that a 5 GB VM size is probably just 4 GB of mapped, shared libraries? That's a lot of libraries, no? (comparable to loading the entire OSX folder into memory and then some?) My mind just boggles at how much "code" is needed to make things work these days.
Sign In or Register to comment.