Apple Event: May 7th at 7 am PT

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

very poor memory management

Hello,


I got a really bad impression on a memory management in Mountain Lion. Here's the situation.

My daily routine reuqires quite a lot of ram: 1-2 eclipse instances, virtual box, chrome with many tabs. For that I bought 8GB of that goodie.
To my surprise, nothing much has changed! usually In just a few days disk swap fills up to 8GB and I get a total of 16GB (RAM + SWAP) memory usage!


The worst part is that closing down the applications doesn't help, I get only a few additional gigs of ram free.


I understand that mac uses free RAM memory to cache stuff, but why the heck it should use 8GB of swap?

Activity monitor also is not helpful to determine who's taking up all the mmeory. Usually it shows ~1.3GB for kernel, 1.3 for virtualbox and around 1GB for chrome.


So, after whining for a few lines, here is my question:
Is there any way to influence OSX memory manegement?

Are there any sophisticated memory view tools to track down the cause of such a "loose" memory manegement?


Thanks,

G.

MacBook Pro, OS X Mountain Lion (10.8.3)

Posted on Apr 22, 2013 6:10 PM

Reply
18 replies

Apr 22, 2013 6:25 PM in response to gingaz

gingaz wrote:


Is there any way to influence OSX memory manegement?

Yes. Use Mac apps. All of the apps you listed are designed for other operating systems. They run on a Mac, but the people who develop them have no interest in making them run well. What happens if you run Xcode, Parallels, and Safari instead?


Also, are you just looking at memory or are you experiencing any undesireable performance? After running all of the apps I listed above for many days, I regularly get down to only a few megabytes free. I usually don't suffer any performance problems from it. On rare occasions (once a month or so) Xcode goes off the deep end and I have to quit and re-launch it. But that's about it.

Apr 22, 2013 7:05 PM in response to William Lloyd

William Lloyd wrote:


Java is a turd. Launch those eclipse instances with -mx256m and you'll have more free RAM on the OS X side 😁

-mx256m would lead to a very, very bad working experience 🙂



Also, are you just looking at memory or are you experiencing any undesireable performance?


Well, running most apps are more or less fine, but I can feel that the whole system is slowly getting into a freeze, becomes innertic (takes longer and longer to load/close something/react). My suspicion is that swap also contains some running app data even thoguh there is plenty of free ram.

Basically osx is not able to recover to a fresh initial state after a very high memory load when apps are closed.



What happens if you run Xcode, Parallels, and Safari instead


Well, I'm quite in too deep into Eclipse and VirtualBox to move quickly and efficiently.
Safari - had a thought to try it, but it's slow compared to Chrome. Still, different apps won't solve this issue, since OSX becomes sluggish even AFTER I close everything (2nd paragraph).


Thanks 🙂

G.

Apr 22, 2013 7:44 PM in response to gingaz

Well your experience is not typical. I can say I typically have uptimes in the 30-60 day range and notice *no* slowdown during that time. Any time I have a "RAM hog" I just close the process. The OS is resilient to these things.


Honestly, Java is a pig, and a VM is a pig as well. The OS is smart with resource utiliziation but Java asks for a TON of RAM and the OS will give it to it. The whole VM model reaks of the old OS 9 model where applications asked for a set allocation. Java and VirtualBox both do this, as they want to "carve out" a huge chunk of RAM for themselves to optimize their performance.


The whole problem on your side is due to how much RAM the two eclipse instances and the VirtualBox instance are taking. You'd get better performance with 16 GB of RAM. I mean, unused RAM is wasted RAM, but there are limits to this, because if the applications demand more RAM than the system has, things will slow down due to paging. How else could it work?

Apr 23, 2013 3:55 AM in response to gingaz

Although I do have 16 gig in my 2011 Mac Mini Server,

I would like to give you an instance of what my work has

been recently.


I run Parallels Desktop for Mac. I have a virtual machine running

Windows8 setup with 4 cores, 4 gig RAM, 512 meg VRAM. Within

it, I have Visual Studio 2012 running a debug session and a Link

Instruments DSO-8502 (a USB based oscilloscope). I also have

a Windows XP virtual machine with 1 core, 2 gig RAM and 256 gig

VRAM assigned running an interface for some custom hadware.

I also have several Safari windows open in OSX almost all the

time for reference information. Also, at times, I have had the

Microchip MPLAB X app running on the Mac side at the same time

for some chip debugging.


Doing all this, I have not seen a single bit of lag or slowdown in

any of my work.


So, suggestion 1, if you are in fact into any heavy development,

dump Virtual Box and use Parallels (or perhaps VMware Fusion).

These are specifically developed for the Mac platform by a dedicated

team and a company that relies on these products for income. Virtual

Box, quite frankly, is just a side show for the megabuck company

Oracle and as such gets that sort of attention.


As for Eclipse, it is a really great open source effort but since it

needs to please all platforms, it is not a master of any and as such

comprimises made for one system impacts performance on another.

Oct 22, 2013 6:38 AM in response to gingaz

It's PROBABLY not a memory usage problem. Using virutal memory is fine. It's the paging memory to disk that slows you down. You can type 'top' into a Terminal window and watch to see when memory is paged to disk (see the "VM:" line, and look at the end for numbers in parenthasis... these are pageins and pageouts). If you have a lot of pages going to and from the disk, this is called thrashing and it's bad. Otherwise, memory is not your bottleneck. UNLESS, you have a bad controller which means the data isn't being shuffled around properly.


Using top, you can see which applications are taking up real memory and virtual memory. Start top as:

"top -o rsize" to get real memory

"top -o vsize" to get virtual memory (make surey you pull the window out so you get a VSIZE column)


Good luck!

Oct 22, 2013 11:22 AM in response to gingaz

Nothing out of the ordinary there. You even have inactive memory... maybe it's:


1) outdated System Management Controller data:

http://support.apple.com/kb/HT3964?viewlocale=en_US&locale=en_US


2) bad ASL logs

See here: http://www.dimitri.eu/mac-osx-slow-caused-by-aslmanager/

What I use instead of that page's commands:

Open Terminal and delete the ASL logs: "sudo rm -Rf /var/log/asl/*


3) badly written background processes and kernel extensions. See my post here:

https://discussions.apple.com/thread/5457195?answerId=23448783022#23448783022

Feb 1, 2014 5:12 PM in response to gingaz

Well, to be honest nothing helped. Now I have installed Mavericks and after one or two days of use it becomes unbearable.


With most of the apps closed it shows:

User uploaded file


In System Monitor totals in columns Real Mem, Private Mem and Shared Mem do not exceed 4GB.


top says:

Processes: 233 total, 3 running, 12 stuck, 218 sleeping, 1357 threads

Load Avg: 1.51, 1.59, 1.64 CPU usage: 6.51% user, 5.84% sys, 87.64% idle

SharedLibs: 1388K resident, 0B data, 0B linkedit.

MemRegions: 59324 total, 4160M resident, 104M private, 810M shared.

PhysMem: 6817M used (1010M wired), 30M unused.

VM: 531G vsize, 1026M framework vsize, 0(0) swapins, 0(0) swapouts.

Networks: packets: 50092646/64G in, 23325018/2729M out.

Disks: 5896845/76G read, 10535359/167G written.


Closing all the apps doesn't help. Purge does not help. Everything lags. What the heck? Am I the only to experience this?


With (more or less) the same apps Windows 8 and linux distros typically consume 3-4GB of ram with plenty of room for a few VirtualBox instances. I am very suprised, where all the memory dissapears in OSX. No clue.

Feb 1, 2014 8:04 PM in response to gingaz

gingaz wrote:


Well, to be honest nothing helped. Now I have installed Mavericks and after one or two days of use it becomes unbearable.

Perhaps it has nothing to do with memory.


I wrote a little diagnostic program to help show what might be causing these problems. Download EtreCheck from http://www.etresoft.com/etrecheck, run it, and paste the results here.



Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

Feb 2, 2014 10:55 AM in response to gingaz

What slowdowns or performance hits are you seeing? Are you just not expecting it to take so much memory? Are you just concerned about how much memory is used regardless of a performance problem?


Much of what is stored in memory is just file contents or applications that aren't loaded but cached for when you need them to load. This is a performance gain and is good. So, that makes your machine faster.


If you are seeing a lot of thrashing when your machine isn't doing much, that could be a problem. Thrashing is when it is reading/writing to disk repeatedly because you are out of memory. To check for thrashing, type "top" at the Terminal.app command line and look for "swapins"/"swapouts".


For example, my machine looks like this when nothing much is going on:


PhysMem: 14G used (1979M wired), 1024M unused.

VM: 881G vsize, 1067M framework vsize, 0(0) swapins, 0(0) swapouts.

Feb 2, 2014 11:14 AM in response to Chadwick Wingrave1

etresoft, a really nice tool you have developed 🙂 The excerpt from the whole report is at the bottom. Nothing extraordinary.


Well, the main slowdown - all apps suddenly start being loaded from HDD.

Whenever I launch or switch to other apps, my previously (for the whole day!) used latex editor starts freezing as if every element of it must be read from the disk. That gets worse if I want to launch a 2GB virtual box (in 10.8 it was still OK).

Eventually it gets to that level where I no longer work just nod from boredom (waiting for something to happen) in front of the monitor like a zombie...


Today the machine works flawelesly (no reboot). So it kind of... fluctuates. Will keep monitoring.

Hardware Information:

MacBook Pro (15-inch, Mid 2012)

MacBook Pro - model: MacBookPro9,1

1 2.3 GHz Intel Core i7 CPU: 4 cores

8 GB RAM


Video Information:

Intel HD Graphics 4000 - VRAM: 1024 MB

NVIDIA GeForce GT 650M - VRAM: 512 MB


System Software:

OS X 10.9.1 (13B42) - Uptime: 4 days 3:12:40


Time Machine:

Skip System Files: NO

Mobile backups: OFF

Auto backup: NO - Auto backup turned off

Volumes being backed up:

Destinations:

MacTardis [Network] (Last used)

Total size: 249.68 GB

Total number of backups: 0

Size of backup disk: Excellent

Backup size 249.68 GB > (Disk size 0 B X 3)

Time Machine details may not be accurate.

All volumes being backed up may not be listed.


Top Processes by CPU:

13% Google Chrome

7% WindowServer

4% sysmond

2% Spotify

2% Insync


Top Processes by Memory:

328 MB Google Chrome

180 MB Finder

164 MB WindowServer

156 MB Skype

147 MB Spotify


Virtual Memory Information:

998 MB Free RAM

3.27 GB Active RAM

1.48 GB Inactive RAM

1.07 GB Wired RAM

34.32 GB Page-ins

950 MB Page-outs

Feb 2, 2014 2:37 PM in response to Chadwick Wingrave1

Hmm, thanks, tomorrow I will try to run through your tutorial.


Any naughty daemon on this list?


Kernel Extensions:

com.rim.driver.BlackBerryUSBDriverInt (0.0.74)

org.virtualbox.kext.VBoxDrv (4.3.6)

com.paragon-software.filesystems.ntfs (82)

org.virtualbox.kext.VBoxUSB (4.3.6)

com.bresink.driver.BRESINKx86Monitoring (9.0)

com.nvidia.CUDA (1.1.0)

org.virtualbox.kext.VBoxNetFlt (4.3.6)

org.virtualbox.kext.VBoxNetAdp (4.3.6)

net.tunnelblick.tun (1.0)


Problem System Launch Daemons:


Problem System Launch Agents:

[System] com.paragon.NTFS.trial.plist 3rd-Party support link

[System] com.paragon.NTFS.upd.plist 3rd-Party support link


Launch Daemons:

[System] com.adobe.fpsaud.plist 3rd-Party support link

[System] com.adobe.SwitchBoard.plist 3rd-Party support link

[System] com.atlassian.SourceTreePrivilegedHelper2.plist 3rd-Party support link

[System] com.barebones.authd.plist 3rd-Party support link

[System] com.google.keystone.daemon.plist 3rd-Party support link

[System] com.insynchq.insync.daemon.plist 3rd-Party support link

[System] com.microsoft.office.licensing.helper.plist 3rd-Party support link

[System] com.oracle.java.Helper-Tool.plist 3rd-Party support link

[System] com.realvnc.vncserver.plist 3rd-Party support link

[System] com.rim.BBDaemon.plist 3rd-Party support link

[System] com.sierrawireless.SwitchTool.plist 3rd-Party support link

[System] com.teamviewer.teamviewer_service.plist 3rd-Party support link

[System] org.freedesktop.dbus-system.plist.mp_1358262446 3rd-Party support link

[System] org.macosforge.xquartz.privileged_startx.plist 3rd-Party support link

[System] org.virtualbox.startup.plist 3rd-Party support link


Launch Agents:

[System] com.adobe.AAM.Updater-1.0.plist 3rd-Party support link

[System] com.google.keystone.agent.plist 3rd-Party support link

[System] com.nvidia.CUDASoftwareUpdate.plist 3rd-Party support link

[System] com.oracle.java.Java-Updater.plist 3rd-Party support link

[System] com.paragon.updater.plist 3rd-Party support link

[System] com.realvnc.vncserver.peruser.plist 3rd-Party support link

[System] com.realvnc.vncserver.prelogin.plist 3rd-Party support link

[System] com.rim.BBAlbumArtCacher.plist 3rd-Party support link

[System] com.rim.BBLaunchAgent.plist 3rd-Party support link

[System] com.teamviewer.teamviewer.plist 3rd-Party support link

[System] com.teamviewer.teamviewer_desktop.plist 3rd-Party support link

[System] org.freedesktop.dbus-session.plist.mp_1358262446 3rd-Party support link

[System] org.macosforge.xquartz.startx.plist 3rd-Party support link


User Launch Agents:

[not loaded] com.adobe.ARM.[...].plist 3rd-Party support link

[not loaded] com.facebook.videochat.[redacted].plist 3rd-Party support link

[not loaded] com.spotify.webhelper.plist 3rd-Party support link

[not loaded] com.valvesoftware.steamclean.plist 3rd-Party support link

[not loaded] org.virtualbox.vboxwebsrv.plist 3rd-Party support link

very poor memory management

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