• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Mac Age - OS X: How Does Ram Work Exactly (Am I Suffering From "Memory Leakage"?)

Status
Not open for further replies.
The other day I downloaded a widget that showed how much ram my Mac is using. I figured it would be a neat little tool to have around, even though its not something that's really necessary. After all, I have two Macs, one is a 1 Ghz G4 with 1 gig of ram, which is more than decent, and a dual Ghz G5 with 1.5 gigs of ram, which is even more capable. I only use them for Mail, Safari, iChat, Word, BitTorrent, and other smaller programs. I occasionally use Photoshop, Dreamweaver, and Illustrator, but I'm by no means a power user.

But even with all those about half of those apps running, and not including the bigger programs, I was shocked to see that I have 199 mb of ram available. How could this be? When I restart I have almost all of it, but as I launch programs more and more get taken, almost at a steady rate. I don't have that memory leakage problem that I've heard of, do I?

Am I just stuck in the ways of Classic where each program used a certain amount of pre-allocated ram? I heard a while back that OS X uses "all of the ram" in an intelligent manner, I forget the specifics.

So, can anyone explain to me what's going on? When I first noticed this on the G4 I though something was wrong, but when I noticed the same exact thing on my G5 (which is not slow at all... the G4 is but I sorta expect that) I knew I had to ask.
 
I'm no memory expert by any stretch of the imagination, but I believe you should be okay. Programs in OS X, as far as I'm aware, do dynamically allocate memory as needed and you can probably test this rather easily by running Activity Monitor, clicking the System Memory tab, an opening and using programs; you should be able to see the RAM sizes shift around.
 
I wouldn't worry about it. Many applications and operating systems allocate a collection of memory onto a protected memory heap and this heap grows and shrinks as applications are running. What you are likely seeing is that the OS has allocated a bunch of your memory into heap and there is 199 MB of ram that is truly free unallocated for anything.
 
I know on linux it tries to use all but a small portion of memory unused by programs for disk cache... so that it'll tell you have 30mb free even though you aren't running much of anything on 1gb of RAM. When programs need the memory it'll free it up for them.

OSX probably does something similar.
 
That's exactly right. Mac OS X tends to eat up all available physical memory, even if there is a lot of it available. This is because Mac OS X caches as much data as it can in memory, so that it can potentially reuse that data without having to re-cache it (the UNIX term for caching data in memory is "paging in" memory).
 
Whenever I'm using Illustrator or Photoshop at work (10.4) after a while those programs will start to slow to a crawl... Quiting them and starting again will fix them, but is there a solution for this ?
 
Burger said:
Whenever I'm using Illustrator or Photoshop at work (10.4) after a while those programs will start to slow to a crawl... Quiting them and starting again will fix them, but is there a solution for this ?

Yea I just got CS2 and that seems to happen to me. I only have 512 MB of RAM though. Probably need to get a 1 gig stick.
 
Burger said:
Whenever I'm using Illustrator or Photoshop at work (10.4) after a while those programs will start to slow to a crawl... Quiting them and starting again will fix them, but is there a solution for this ?

Not really no. As you create layers and use filters and such, these applications could actually be leaking memory on the heap in the form of objects that don't get allocated because either they are still in use (which sounds about right since they go away when you restart) or bad malloc/free pairs - which happens a lot in larger C/C++ applications.
 
i find that in photoshop, if it starts to chug you can go 'edit-->purge--> all' which will clear history/clipboard etc - if you hvae a stack of steps in the history it tends to speed it up a little, and clear some scratch disk space
 
Phoenix said:
Not really no. As you create layers and use filters and such, these applications could actually be leaking memory on the heap in the form of objects that don't get allocated because either they are still in use (which sounds about right since they go away when you restart) or bad malloc/free pairs - which happens a lot in larger C/C++ applications.
as in the post below yours, i'd be willing to bet that these apps just clog themselves up with all their per-session bookkeeping. these companies go through enough testing that leaking should be isolated enough that it won't slow your work to a crawl in any reasonable amount of time.
 
Status
Not open for further replies.
Top Bottom