by 4ad · 14y ago · 0 comments
When someone rants about memory usage it is usually a sign he knows nothing what he is talking about. On virtual memory systems with on-demand paging that use shared libraries and where all file system I/O is mmap(2) based, memory is managed in a very different way than what most people expect. It's understandable, most people don't know and don't have to know what virtual memory is, even if they have a superficial understanding of swapping. Most people, even most technical people, don't know about the implications of shared libraries in memory measurement.
The users are presented with data they don't understand. Everybody talks about things like "this app is using 300MB of RAM", when such statements don't make any sense in the modern world. The way file systems, file system caches, virtual memory, and shared libraries in the context of virtual memory interact is architecturally identical on all major operating systems today, including Windows, Mac OS X, Linux, Solaris, and the BSDs. There are various differences in implementation making each system optimized for particular workloads, but understanding the differences between the system is out of reach of most people who complain on their blogs, and it only affect out-of-reach workloads anyway. It's funny how much can one advocate for something when all alternatives are the same.
But all memory management rants are nothing compared to mentioning Mac OS X' repair disk permissions feature. Of course, this feature doesn't magically repair anything, but it's sold as a panacea. I read the first paragraph about memory management and decided to give it one more chance, but then repair permissions was mentioned as a solution. Sorry, this is no HN worthy.
I face no such problem with Linux or FreeBSD in the same hardware.
If your computer frequently freezes, the problem is mostly a specific application (Virtualbox comes to mind), not just Mac OS X itself. 4GB are more than enough for casual browsing.
Activity Monitor presents data that's not really useful and does so in an intrusive manner and in a confusing display.
Mac OS X already comes with parts of the DTrace toolkit, you can install whatever you're missing: http://www.brendangregg.com/dtrace.html#DTraceToolkit. These tools allow a very deep understanding of performance problems.
If you want to know why a specific app is frozen (beachballing), you can click the "Sample Process" button in Activity monitor to perform a time profile.
Yes, if you want more details, you have to use Instruments or write your own DTrace scripts. But I doubt that even a time profile is useful to the "casual user".
My default set of apps that I run:
1. Safari 2. Mail.app 3. Terminal.app 4. Adium 5. Twitter 6. iCal 7. X11 8. MacVim 9. GitX 10. Activity Monitor
I have no slow-downs and I regularly compile the entire companies code-base on this little machine. Sure it isn't fast compared to some of the newer monsters out there, but I have had no issues with slow downs what so ever.
That being said, I don't use Chrome, and I don't have DropBox on my work laptop.
I keep hearing about people having really bad slow downs and I just don't understand it. Mac OS X has never been anything but "Just Works" for me.
11:29 up 69 days, 17:34, 11 users, load averages: 1.38 1.24 1.18
When the slowdowns bother me I look at usage. On the Mac I always have 4 spaces open (the dashboard is not set as a space on my Mac), and at all times I have the following apps open: Mail.app, Terminal.app, Chrome w/>=5 tabs at a time, MAMP, CodeKit, iTunes, and Sublime Text. Then Photoshop is open a lot in a addition to a lot of others that get opened at times. On the netbook I've got a terminal session, Chrome, and Sublime Text. That's it. It's no wonder the Mac slows down. So I'd say look how you use the thing. No machine has unlimited performance and when it comes to memory usage it's a lot like money in that the more you have the more you tend to spend and you never seem to be able to have enough.
This computer stays up for several days[1], and I suspect the main cause is because of Chrome leaking memory.
[1] Now: 20:16 up 43 days, 23:41, 2 users, load averages: 0.38 0.31 0.26
If I do a malloc of 7GB with 6 GB free and 800 MB of inactive memory on my MBP, the system starts paging before it deallocates the inactive memory.
If I ctrl-c the application, suddenly the active and inactive memory go down drastically, with inactive going to like 100 MB, so it obviously could have been given to the process wanting it before paging started.