Mac OS X Lion (10.7) Poor Memory Management Decisions
| Originator: | jon | ||
| Number: | rdar://11840566 | Date Originated: | 10-Jul-2012 11:18 AM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | 10.7.4 |
| Classification: | Performance | Reproducible: | Always |
10-Jul-2012 11:18 AM Jon Stacey: Summary: Mac OS X Lion (10.7) makes poor memory management decisions that lead to unnecessary swapping and very poor performance, particularly on Macs using an HDD rather than an SSD. In short, OS X prefers to write and read to swap rather than freeing inactive memory. This behavior is consistently reproducible after extended use of Mac OS X. Steps to Reproduce: Simply use your computer for a few days while keeping an eye on the System Memory tab of Activity monitor every once in awhile. You will notice that OS X chooses to page out or in despite the fact that there may be significant inactive memory that could [and should] have been freed instead. Expected Results: OS X should never touch the swap file unless it is absolutely necessary. From my first screenshot example, on my iMac with 12GB of memory, 8GB of it free, OS X should not be touching swap at all. And yet, OS X is choosing to make this poor performance decision which eventually leads to a system-wide slow down that was avoidable. From my second screenshot example, note how after continued use, OS X chooses to page more rather than to free inactive memory. In the second example, OS X still should not even be thinking about using swap. 7+GB of inactive memory is outrageously excessive. Actual Results: See one of my attached screenshots for a very basic example. This is on a rebooted system after just a short period of use. Despite having nearly 8GB of FREE memory, OS X is choosing to page in and out. On the second example, OS X is choosing to touch swap despite there being 7+GB of inactive memory that would be better freed and used instead of touching the excruciatingly slow HDD. Sure, keeping some content in memory as a cache is nice and faster, if it's used, but OS X is going so far in this direction that it causes overall poor performance. Unless the swap I/O is just as fast as memory [which it is not with an HDD], then OS X should prefer to use memory over swap, even at the expense of convenience cache. Regression: This has been a problem for quite a long time now, but I've finally been ticked off enough to file a bug report. Notes: Note in my second screenshot example with 7GB of inactive memory that the problem is really exacerbated if I were to launch a memory heavy application such as Parallels Desktop. OS X in that case would begin heavily swapping instead of freeing up that inactive memory, so the computer comes to a screeching stuttering halt while Gigabytes of swap are written and read instead of just clearing the damn inactive memory. This issue is less noticeable if you have your swap files on an SSD, but nonetheless these are poor performance decisions on the part of OS X's memory management subsystem. 10-Jul-2012 11:18 AM Jon Stacey: 'Screen Shot 2012-07-09 at 1.07.38 PM.png' and 'iMac.spx' were successfully uploaded 10-Jul-2012 11:19 AM Jon Stacey: 'Screen Shot 2012-07-10 at 11.02.54 AM.png' was successfully uploaded
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!