Leopard - what the hell is eating all my ram?

Discussion in 'macOS' started by Sharky II, Jun 15, 2008.

  1. Sharky II macrumors 6502a

    Sharky II

    Joined:
    Jan 6, 2004
    Location:
    United Kingdom
    #1
    Hi

    I'm baffled as to how much ram leopard uses, and how it uses it.

    So right now i just had absolutely nothing running other than activity monitor. And a couple of widgets. Set somehow nearly 1.1gb was being actively used - huh? See attached pic.

    I find leopard to be a real ram hog. I have a MBP Core Duo 2.16GHz 15", with 2GB Ram, and i can't believe 2gb is not enough these days. It's a huge amount if you think about it.

    Furthermore, quite frankly i don't believe the common idea that OSX will use up any 'inactive' ram as if it were free ram. The number of times i've been using logic pro or aperture and there's been nothing but a couple of mb of 'free' ram, a fair amount being being 'used', and loads 'inactive'. I'd shut down all other apps, so why wasn't it eating up all that 'blue' inactive ram? The HD was going crazy with all the paging, and apparently i had a fair what of 'inactive' ram just sitting there.

    Finally - when using activity monitor and viewing 'all processes' - the sum of the activities is nowhere near the total ram usage that's being reported by Activity Monitor and all/other applications. This again can be seen in the pic i attached. Why am i using 1.52gb when NO other apps are running? Even if 'inactive' ram is 'free', it's still got 1.1gb that's WIRED when no apps are running. As you can imagine, when i launch mail, safari, itunes, ichat, msn, etc, i am pretty low. A restart helps, but i've just noticed it getting worse and worse with leopard. My system is clean, no weird software.

    Can anyone shed some light on this? I really don't think OSX is as super high tech when it comes to ram handling, as people like to make out. When i have 6GB of ram on my mac pro, sure it's nice. But when I'm limited to 2GB, it's method of handling memory seems to be a little ridiculous.

    Cheers
     

    Attached Files:

  2. The General macrumors 601

    Joined:
    Jul 7, 2006
    #2
    Calm down. What is the point of having 2GB of RAM if you're not going to be using 2GB of RAM?

    Your computer is using 1.1GB of RAM, and you have 2GB. How does that mean that 2GB is not enough? I have 4GB of RAM and my computer says 1.35GB are active.

    How much RAM do you want it to use? 512mb? 512k? Why not use what resources you have?

    It's not a big deal.
     
  3. Sharky II thread starter macrumors 6502a

    Sharky II

    Joined:
    Jan 6, 2004
    Location:
    United Kingdom
    #3
    Um, i'm pretty calm. I'm confused as to why you'd use the old 'calm down' trick to try to make out like i'm shouting or being irrational when clearly i'm not - just because i questioned OSX or leopard?

    When my machine is booted up, it only has a few hundred mb used. Now, obviously that's because it hasn't had to allocate any memory to anything yet. However, once my machine has been used to do a couple of things OSX seems to eat up more and more of my ram, which i essentially never get back.

    When i use an app and then quit it - and every thing else, according to how OSX handles ram, most of the ram used for that stuff should be free - some can go into inactive ram so that if you relaunch that app or reuse some data, etc, it has faster access to it. That may be happening properly, or it may not. Thing is, as i explained in my original post, when i'm paging out and expecting that inactive ram to be gobbled up when needed - as it should - it's not being used. I'm paging out when i have a load of 'inactive ram'.

    To make it clearer for you, as you didn't answer any of my questions:

    1) Activity Monitor does not accurately report how much ram is being used - either the total is wrong, or processes that use up ram which aren't being reported/shown.

    2) Inactive Ram is not 'freed up' when it needs to be, as apple and forum posters say it should be

    3) Ram stays 'used' after i've quit applications. It should be in 'inactive' ram. If not, it should still be freed up when it needs to be. For example i had 1.1gb used when no apps were running. If i launch safari, aperture, itunes, etc, it will not give me back any of that 1.1gb - all these apps will have to run in the remaining 900mb of available ram - not a chance of doing that without a page out. OSX is hogging ram for some reason. Perhaps it's a particular application i use, perhaps it's a problem with leopard, etc.

    Exactly as you said, i want it to use the resources i have, instead of just running slow and telling me i'm out of 'free' ram.

    "Your computer is using 1.1GB of RAM, and you have 2GB. How does that mean that 2GB is not enough?"

    My machine is using 1.1gb of ram with no applications running - other than activity monitor. Now, if this was all 'inactive' ram, which i could see was freed up when OSX or an application needed it - fine. But it's not. OSX is not allocating that ram as 'free' or 'inactive' it's just wired, full stop. When i launch a couple of applications or use more data, etc, more and more of that 2gb is eaten away. None of the 1.1gb is being freed up.

    This matters because my machine runs like crap when i know it's very capable. This was never an issue with Tiger. Even with my mac pro, it's so damn memory hungry. I can't help feel like things are coded very inefficiently.

    I can't see how it could be any clearer for you.
     
  4. Sun Baked macrumors G5

    Sun Baked

    Joined:
    May 19, 2002
    #4
    Calm down, if the machine has had a lot of uptime, you will have some pageouts.

    I have more memory used and basically nil on free memory, with the same 2GB.

    I'm not worried, performance hasn't suffered yet.

    ---

    Check the logs to see if there a backround app sucking cycles, mine only ran like crap with the spotlight indexing and the dyld cache restarts.

    Though if you do run into the random slowdowns, checking the fonts and purging the font cache seems to help. If it is something like a hoggy kernal_task pegging usage.
     
  5. ihabime macrumors 6502

    Joined:
    Jan 12, 2005
    #5
    If you really want to understand how OSX memory allocation works you should look through this, http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/ManagingMemory.pdf

    Active memory consists of pages that are currently mapped into memory and have been recently accessed. This not only means memory being used by running applications and recently quit applications, but also caches of files loaded from disk, shared data, clipboard, tons of little things.

    Inactive memory is the same, but it hasn't been accessed recently.

    There really isn't a hard line, things slide from active to inactive over time. By slowly sliding memory pages towards deletion as it's needed, they keep your most recently used data closer to you fingertips.

    When memory is needed first it comes from free, then inactive, then active.

    That said, it seems like Apple may have changed the way they report active/inactive memory a bit in leopards activity monitor. I don't remember seeing quite so much active memory lying around in tiger, most likely it's just a matter of where they draw the line.

    If you think that's neat, try this. in Activity Monitor, right click on the column headers and add either the Shared Memory or Private Memory column, but wait, keep your eye on your VM Size while you do it. Amazing isn't it, you can shrink your virtual memory usage to a tenth just by adding a column.

    BTW I'm willing to admit that that might actually be a bug :p
     
  6. The General macrumors 601

    Joined:
    Jul 7, 2006
    #6
    TLDR

    Anyway, I used "calm down" because you're obviously worked up about it judging by the language and rhetoric you used in the title of your thread.
     
  7. PcBgone macrumors 6502

    PcBgone

    Joined:
    Feb 3, 2008
    #7
    I dont think its a leopard issue.

    Im running 10.5.3, on a 2.8ghz imac, with 2gbs of ram. I currently am running itunes, ichat, safari, mail, along with the activity monitor. I have less then gig being used.

    Is it possible one of your ram sticks may be in the process of failing? How old is your ram?
     

    Attached Files:

  8. JavierP macrumors regular

    Joined:
    Mar 17, 2008
    #8
    It's the disk cache

    You can control how many files are stored in the SO RAM disk cache, using the command sysctl kern.maxvnodes=x . In order to know how many files max. are being cached now, execute sysctl kern.maxvnodes.
    I have 4Gb of RAM and I modified the default value so that 2.0 Gb of RAM is used for disk cache. sysctl kern.maxvnodes=300000 .
    If you need more RAM for applications, set this param to a lower value.
    If you have RAM to spare, you can really speed things up this way
     
  9. scaredpoet macrumors 604

    scaredpoet

    Joined:
    Apr 6, 2007
    #9
    No, he said "calm down" (and it's not a trick, by the way) because you're making a mountain out of a molehill. Not to mention the use of bold text and the quick conclusion that "Leopard is a memory hog," without any real analysis of the issue.

    On the other hand, I can counter that you're using the "My experience is the only valid experience and everyone else is wrong" righteousness trick. Whereas, the experience of others (including my experience over several Macs running Leopard) is quite different. Case in point:

    [​IMG]

    This is after running Safari, Adobe Photoshop CS3, Acrobat, running Terminal, and Office, and then shutting them down to just Safari, Grab, and Photoshop.

    I'm not so sure you should be pointing the finger at Leopard SO much. Safari? Probably. Or, some other piece of software you might be running that is poor at memory management and not freeing up RAM when it's no longer being used. If you're running apps that worked fine in Tiger but take advantage of APIs or other components that have changed in Leopard and have not been updated, that could be another cause.

    If an app is marking the RAM as allocated and not freeing the space up, then this is going to happen. Is that Leopard's fault? No. It's SOME developer's fault, but I don't think the blame falls in the OS X camp.
     
  10. steve_hill4 macrumors 68000

    steve_hill4

    Joined:
    May 15, 2005
    Location:
    NG9, England
    #10
    I'd much prefer to see the system gobble up as much RAM as is available and keep performance at an optimum. If all is used and you launch another app, it will reallocate accordingly.

    What's the point in owning a sports car if you want to constantly keep it under 30?
     
  11. skye12 macrumors 65816

    skye12

    Joined:
    Nov 11, 2006
    Location:
    Austin, Tx
    #11
    Not sure what version of Leopard you're running, but I found my new penryn
    MB started using ram more efficiently after updating to 10.5.3 from 10.5.2.
     
  12. Industries macrumors newbie

    Joined:
    Jun 12, 2008
    Location:
    North Carolina
    #12
    Hi.

    I understand your situation, but there is no need to get worked up. I have an Intel Mac mini (w/ 1gig ram), and it works heavenly, even when running Virtualbox (384mb ram alotted to the guest).

    Are you actually getting very slow performance? If so, maybe you should try calling up Apple, because, once again, I run a vm on my Mac mini w/ 1gig ram and it still doesn't really get much slower (just a tad).

    I still wish I had 2. :(
     
  13. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #13
    The important figure to look at in the screenshot is the "Swap Used" number, which indicates the amount of swap memory used (i.e. on the disk instead of in memory and it is this figure that is most analogous to the virtual memory used in Windows). On the OPs screenshot, it shows 120.06MB, which indicates very light use of swap space, and therefore no real issues with running out of memory.
     
  14. tdhurst macrumors 68040

    tdhurst

    Joined:
    Dec 27, 2003
    Location:
    Portland, OR
    #14
    Hmmm

    Is your computer any slower or are you just the type of person who frequently checks activity monitor?
     
  15. IJ Reilly macrumors P6

    IJ Reilly

    Joined:
    Jul 16, 2002
    Location:
    Palookaville
    #15
    The only way to really tell if you're overflowing physical RAM is to monitor your virtual memory swap files, which are stored at private/var/vm. As of Tiger, these directories are not visible without using a utility like TinkerTool to reveal them. Add the /vm directory to your Sidebar, then rehide the hidden directories. The default swap file is named swapfile0, and should have a size of 64 MB. Files are added as swapfile1, 2, 3, etc. doubling in size each time. Whenever my swap files get beyond swapfile3, I reboot. I found that running Leopard with 1 GB of RAM produced three or four swap files nearly every day (iPhoto seemed to be the main culprit), so I rebooted that often. I just upgraded to 2 GBs so I expect this issue to diminish substantially.
     
  16. PkennethV macrumors 6502a

    Joined:
    Aug 16, 2006
    Location:
    Toronto
    #16
    mkay...I'm not too technical, but I've noticed pretty much the same thing with Leopard. After working Aperture, Camino, aMSN, iTunes, Photoshop, Text Edit open and quitting them (i'm the type of person who checks Activity Monitor frequently:D), my Activity Monitor basically shows the same thing as the OP.

    Like others have said, I wouldn't be concerned unless the computer is actually feeling slower. In my experience, everything in Leopard seems to be *a lot* snappier than Tiger. So i don't really care what the computer calls "active" or "inactive" RAM if my computer is runner smoother in the end:)
     
  17. cherry su macrumors 65816

    cherry su

    Joined:
    Feb 28, 2008
    #17
    Dashboard widgets, perhaps? Each widget takes like 7-10MB
     
  18. Gregorius macrumors newbie

    Joined:
    Sep 7, 2008
    Location:
    Los Angeles (Silver Lake District)
    #18
    Re: Leopard - what the hell is eating all my ram?

    The whole swapfile issue is a bone of contention with me. Swapfiles in vm multiply to the point where everything freezes and an error alert says that I have no memory. I can move the mouse but nothing else. I have to force reboot. This happened in my older iMac G5 (2.0 GHhz, 500 GB Hard drive) which had two Gigs of RAM (and 125 Gigs free hard disc space, which would disappear down to 50 gigs)). I literally just bought a brand new iMac G5 (2.66 GHz, 750 GB hard drive) with 4 Gigs RAM -- I set it up yesterday -- so it can't be "old" ram. The same problem is happening here. Some 30 gigs of vm/swapfiles are appearing causing my computer to freeze and causing me to shut down and reboot. And this is not necessarily due to heavy application use. I have also called Apple about this - to no avail. Here is a recent screen capture of the private/vm folder (I should have 342 gigs of free hard disc space - some 40 gigs have been "eaten" up):
     

    Attached Files:

  19. eXan macrumors 601

    eXan

    Joined:
    Jan 10, 2005
    Location:
    Russia
    #19
    What the hell do you do with your iMac to swap crazily like that????????
     
  20. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #20

    I seem to have the same issue, I don't know if this is light or heavy use or somewhere in between...

    Mail
    Skype
    Adium
    Terminal
    Terminal
    Safari
    iTunes
    Last.fm

    Then I either run Photoshop, Dreamweaver, or XCode.

    My vm directory is only 8GB but according to activity monitor my VM size is almost 60GB.

    This is after I closed the big programs...
     

    Attached Files:

  21. Gregorius macrumors newbie

    Joined:
    Sep 7, 2008
    Location:
    Los Angeles (Silver Lake District)
    #21
    Do? If I knew I wouldn't be posting here. LOL ;-) I only have experienced this with Leopard -- and I've been a Mac user since day one (1984).
     
  22. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #22
    You paid for 2GB of RAM. The operating system does its best to _use_ that RAM. Unused RAM is completely pointless and a waste of money. How often do you read here on MacRumors that people are told to upgrade the amount of RAM in their Macs to make it run faster? And how could 2 GB instead of 1 GB make any difference if the operating system doesn't actually _use_ that RAM?
     
  23. cluthz macrumors 68040

    cluthz

    Joined:
    Jun 15, 2004
    Location:
    Norway
    #23
    I'm only running firefox atm, and this is my activity monitor.
    3.24GB used. It's normal.
     

    Attached Files:

  24. IJ Reilly macrumors P6

    IJ Reilly

    Joined:
    Jul 16, 2002
    Location:
    Palookaville
    #24
    Yes, this is very extreme. How long does it take to build up that many swap files? I'd like to look at that list in list view, to see the creation dates for the files. Like I said, when I get to swapfile3, it's reboot city for me, and that usually takes several days or a week of normal use at 2 GB of RAM.
     
  25. Gregorius macrumors newbie

    Joined:
    Sep 7, 2008
    Location:
    Los Angeles (Silver Lake District)
    #25

    Hi,

    Here is a screen shot of my the vm folder in list view with creation times. I rebooted about 7:15 PM this evening (9/8). I'd sure like to know what the heck is causing this! (Remember, this is virtually a brand new computer -- just set it up on Saturday.)
     

    Attached Files:

Share This Page