Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

os X server memory leaks?

Hi, I'm running OS X server (l10.4.8), all firmware updates current, on a Mac Pro with 2 GB RAM. After a restart, Activity Monitor reports about 180 MB or less of wired memory. However, in a matter of a few days, or even in a few hours, this climbs up to almost 1 GB. The culprit seem to be "kernel_task". Not sure how performance is being affected but this obviously should not be occurring. Services running are AFP, DHCP, DNS, Mail, Open Directory and VPN. This is a small office with only two client machines connected, a macbook pro and an intel imac. I'm having Cocktail run all of its scripts daily without any affect. Logging out also does nothing. Any ideas on why this is happening and how to prevent this would sure be appreciated!

This post mirrors one I started earlier in the mail services section at http://discussions.apple.com/thread.jspa?threadID=699369. I believe that it's more appropriate for this discussion to be in this category though.

2.66 ghz Mac Pro, 2 GB RAM, Mac OS X (10.4.8), running OS X Server

Posted on Jan 15, 2007 9:08 AM

Reply
61 replies

Jan 15, 2007 11:47 AM in response to thufir

Howdy,

I've been rather angry at my brand new Xserve Xeon (2x2GHz) with 4 Gbyte memory - all factory installed. Been searching for all types of information and saw this post (on it's old thread). Just opened Activity Monitr to watch kernel_task.

It used some 1000 mbytes of "Real Memory" and 2,6 GB Virtual Memory.

Then opened a window and typed a word to search for. Found a lot and closed the window.

And both types of memory had increased!!!

Now I hoped the process would also give some memory back - but no. No such things. Memory allocation increases but does not seem to decrease.

Runs Server 10.4.8 factory installed and updated. AFP, Windows (file and backup domain controller), VPN, OD replica, DNS (secondary).

The craches I've had forces me to physically reboot. I can't reboot thru LOM - althou I can get status from Server monitor. When I watch the processor activity indicators on the front before rebooting, they either grow and schrink "periodically" or one of the cores are rocketing continously.

Don't know what information is the same for you - but I'm pretty boorde with this one!

Greetings from Sweden

Tobias

Jan 15, 2007 12:01 PM in response to thufir

I am also having this problem on my Mac Pro with 2gb of RAM. Essentially over time my Wired Memory increases to about 1.95 gb, and my machine crashes. This happens on a clean install of OS X Server 10.4.8 I've even gone as far as disabling all of the services that were running and I'm still met with the same problem. Currently, after 1.5 hours of uptime I have 917.25mb of wired memory eaten up out of a possible 2gb of RAM. All the RAM modules were factory installed as well.

Jan 15, 2007 12:27 PM in response to thufir

> this obviously should not be occurring

Why not?

Have you not read any of the multitude of discussions regarding memory usage in Mac OS X?

Mac OS X uses a number of caching algorithms to cache recently accessed data. This data might be anything, including application code, disk-based data, documents.

As a result, over time the 'used' memory will increase and, in an ideal world, consume nearly all of the memory in the machine.

('free' memory should be relabeled as 'wasted' memory)

The 'wired' memory is memory that's actually in use. This will increase with load and the number of applications/processes that you're actually running. I would expect this to be low after a restart since you haven't started doing much with the machine yet.

As long as the machine isn't running out of memory and crashing I don't think you have anything to worry about.

Jan 15, 2007 12:37 PM in response to Tobias Ahl

> I've been rather angry at my brand new Xserve Xeon (2x2GHz) with 4 Gbyte memory

Then you need to understand how memory works in Mac OS X.

Mac OS X uses lots of caching techiques to improve performance. Recently-used data is held in a cache so that it can be retrieved quickly if needed. Why should the OS spend time throwing memory away when a) it doesn't need that space and b) there's a chance you'll need it again soon.

You can test this by doing the following:

1) Take a memory reading (#1)
2) Launch an app
3) Take another memory reading (#2)
4) Quit the app
5) Take another memory reading (#3)
6) Relaunch the app
7) Take another memory reading (#4)

What you'll find is that the memory usage at #2 is larger than at #1. This represents the memory needed to launch the app.
When you quit the app that memory is not immediately released, so memory reading #3 should be about the same as #2.
When you relaunch the app you should find it launches much quicker than the first time - this is because much of the data is already in memory, thanks to the cache.
You'll also find that memory reading #4 is about the same as #2 and #3, indicating that the OS is using the same memory - it's not using a new block of memory for the second launch of the app.

This is all perfectly normal, and nothing to worry about.

Now, if you're running into crashing problems related to memory, that may be because you don't have enough real memory for what you're trying to get the machine to do. The important numbers to look at are not 'used' or 'free' (wasted) memory, but the 'wired', 'active' and 'inactive'.

If the sum of 'wired' and 'active' are close to the amount of memory in your machine then you're going to have problems. 'inactive' can represent the cached data and if that and 'free/wasted' memory is also low then you will be experiencing performance problems because the OS cannot cache enough data, so things are going to slow down.

As for the CPU activity lights, there's no way to tell from here if that's normal or not. Without knowing the processes you're running or the load on the machine it's impossible to tell if that's normal or not.

Jan 15, 2007 12:40 PM in response to Apex81

It sounds like you don't have enough memory. Don't blame the OS for having trouble when you don't give it the resources needed to do what you ask.

"wired' memory represents the memory that's actively in use by the OS and cannot be paged out to virtual memory. It usually corresponds with the activity on the machine and will vary depending on the applications you're running.

Of course, you don't say what apps you're running, so it's impossible to tell for sure but if it's using 1.95GB out of 2GB in the machine it's trying to tell you that it needs more, or you need to ask it to do less.

Jan 15, 2007 12:40 PM in response to Camelot

In my case the wired memory fills up until no ram is left, and then freezes my system. It seems that once I quit an application of turn off the services that are running the ram is never freed up. I've done some rudimentary tests with opening one application and watching the wired memory increase, then closing the application and having that amount of ram remain in the wired state permanently until I reboot. For me OS X server generally "runs out" of memory once a day and crashes.

Jan 15, 2007 12:50 PM in response to Camelot

Three thoughts in response to the most recent posts that suggest we don't have a problem:

1. If this is normal, then why has Apple referred my case to their engineering department to resolve it?
2. There are oviously others who are experiencing the same problem and their servers are regularly crashing.
3. We're talking about wired memory, not used memory. We're also talking about memory being grabbed specifically by the kernel. In fact, I can literally see the kernel grab hundreds of megabytes within minutes without launching any applications or doing any tasks.

Jan 15, 2007 1:05 PM in response to Camelot

> this obviously should not be occurring

Why not?


For example because the same server under the same load running 10.4.8 ppc (I am luckily having this problem on ppc xserves) doesn't exit, but only occurs when running the 10.4 universal build.

You should listen to em complaining boys this time. There is something wrong there and its not having not enough ram.

-Ralph

Jan 15, 2007 1:10 PM in response to thufir

>1. If this is normal, then why has Apple referred my case to their engineering department to resolve it?

From the little information I have from your post, it's obviously impossible for me to diagnose your problem completely. If you've provided more information to Apple and they've determined that there is a problem then I defer to them. It's just that I haven't seen anything (yet) that indicates that.

>2. There are oviously others who are experiencing the same problem and their servers are regularly crashing.

The understanding of memory usage in Mac OS X is generally quite poor. Most people see a low 'free' memory number and panic, without understanding what it really means. I bet that a large number of the people reporting memory problems are really saying "I don't know how memory works" rather than "I have a memory problem". Not all, for sure, but more than you might think.

>3. We're talking about wired memory, not used memory. We're also talking about memory being grabbed specifically by the kernel. In fact, I can literally see the kernel grab hundreds of megabytes within minutes without launching any applications or doing any tasks.

As I've said, there isn't enough information posted to diagnose the problem. I can tell you I have machines running here that are using more 'wired' memory than you report, but I know it's not a problem because I'm working my machines hard.
So saying that you're using 2GB of wired memory doesn't say there's a problem. Adding that the machine is idle changes the equation somewhat.
However, it's also not an absolute, so there must be some facet of your configuration that's impacting it.

Jan 15, 2007 2:21 PM in response to thufir

I guess I should be more specific. I have been idleing the server all day. No applications are open aside from the Activity Monitor, no services are running. It is also a fresh install of OS X Server 10.4.8 (Univeral) within one hour of my boot the wired memory has climbed from a measly 58mb to 917.41 mb.

I've read the article http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/A rticles/AboutMemory.html


What I don't understand is that on any other ppc/intel machine I work on the wired memory will slowly shrink and resources are freed up.

Once I add the wired memory with the active memory I'm left with a really small amount of ram left to operate anything. 271mb to be exact... Thus, once I start services or an application I crash!!!

Jan 16, 2007 12:36 AM in response to Apex81

I would have no problem to agree with you camelot. And I do think the handling of memory to increase performance aren't to complicated. But as far as I can see - memory handling should not depend that much on hardware. Mac OS X is Mac OS X. PPC and intel alike.

But when I compare my two PPC (G4) servers with 1,5 gbyte wired memory and rather small discs (some 30 and 80 gByte), they do not show the same behavior as my Xserve Dual Xeon with 4 gbyte wired memory and 750 Gbyte boot disc.

The PPC does not go down, but my Xeon has already 4 times in just a bit more than 1 week. And the Xeon "consumes" more memory on rather simple tasks - like searching.

And 4 Gbyte of memory. Is that not a lot? We are no more than 10 simultanious users of the machine, using AFP, Windows and occassionally VPN. And only 2 or 3 of us handles massive files (up to about 40 MBytes) for graphical purposes or CAD work.

But if anyone can give leads in other directions - no one would be more happy than my self. But where to look?

Jan 16, 2007 12:45 AM in response to Tobias Ahl

>The PPC does not go down, but my Xeon has already 4 times in just a bit more than 1 week. And the Xeon "consumes" more memory on rather simple tasks - like searching.

If you're searching on the Xeon, that implies you're running apps on the Xeon.

Have you confirmed all the applications you're running are Universal Binaries (i.e. are compiled to run natively on the Intel processor). If not, and you're running a PowerPC binary, that also means you're running Rosetta which has a large memory footprint, both for Rosetta itself and for the dynamically-recompiled application that you're running. It wouldn't surprise me if much of that Wired memory is taken up by Rosetta and its associated parts and pieces.

All my servers run headless, and only run Intel-native processes. Maybe that's why I don't have such problems?

> And 4 Gbyte of memory. Is that not a lot?

That depends. Nowadays, it's not a lot, but it should be sufficient for most uses. All of my servers, though, have either 8 or 16GB of RAM, but that's because I'm loading them up running large web sites. Only you can look at your workload and determine what's an appropriate amount of RAM to install.

Jan 16, 2007 2:38 PM in response to Camelot

Camelot makes a good point there although I still think this might be an OS 10.4.8 Univ issue.
I think I remember one other person with this issue saying they run Retrospect. I do too and this is still a PPC app unless the update is out. I know there is a Universal coming but I still have the PPC build.

I'm going to disable the "Retro Run" and Retrospect for a day or 2 and reboot tonight and see how the Weird/Active memory and kernel task memory looks.
I'll post back the results. BTW I use AFP/Mail/OD/Web(local)/SWU/SMB for 30 users on max.

Jan 17, 2007 1:50 AM in response to Camelot

This is indeed interesting. Thank's for you help Camelot!

I have kept a close watch and after some 22 hours uptime wired/qctive/inactive/used memory hits 950MB/131MB/291MB/1,34GB. The wired figure does not increase drastically right now. Maybe I havent hit any non-native binarys so far...

For me then thou next questions appears: how do I tell a intel native binary from a PPC one? The software on my Xserve Xeon came preinstalled from factory and as far as I can tell, I haven't installed any application besides the preinstalled. This means at least from my point of view that there must be
non native binarys in the preinstalled or as a result of updated Mac OS X software.

And then of course - if there are core binarys which may need re-compiling to be native. How do I do that? Re-install from DVD which came with the server?

os X server memory leaks?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.