Home · Register · Search · View Winners · Software · Hosting · Software · Join Upload & Sell

Moderated by: Fred Miranda
Username   Password

  New fredmiranda.com Mobile Site
  New Feature: SMS Notification alert
  New Feature: Buy & Sell Watchlist
  

FM Forums | Post-processing & Printing | Join Upload & Sell

1
       2       end
  

Archive 2013 · Mac users with lots of RAM (Speed Up Tip)
  
 
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #1 · Mac users with lots of RAM (Speed Up Tip)


I was researching some ways to optimize my system for photo editing and web browsing (which is about all I do with my system these days - being retired and all) when I came across an article by Perry Metzger written on Apr 3, 2012. The article outlined how to turn off OS X Lion's dynamic paging MMU system. I thought whack at first but I have 32GB of ram and haven't ran out or even neared the top for months so I decided to give it a try. The commands to do this are:

    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

    followed by a reboot. And you can turn it on again with:

    sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

I notice SIGNIFICANTLY less drive chatter and many many operations are noticeably faster. Especially OS operations like browsing around in folders with hundreds or thousands of images in each. Icons once displayed are actually instant... I don't mean fast either. On my system they were fast before. This is instant. Poof! A maximized window populated with any sized icons of RAW (or any kind of) images just appears and scrolling to the bottom of multiple folders each containing 4,000+ images works the same way. Browsing images in LR was sped up by about 10 or 20% too. Good news for those who like LR. Bridge was already very fast (about 6 to 8 times faster than LR) for poking around in image folders but it too became slightly faster. It's too fast in the first place to measure proper differences but doing the best I could with my stop-watch it's about double the speed with 1st time page displays (from about 2s to about 1s) and instant every time after that - for hours and hours and hours... and hours...

I don't recommend doing this with only 8GB or less however. But if you have 24GB or more then I feel comfortable recommending running your machine full-time with the dynamic pager turned off. 16GB would probably be OK too. It works on my older 12GB mac pro system just fine. This is why "with lots of RAM" is in the title. Furthermore you should probably run some kind of memory monitor in the BG. I've been using MenuMeters since, like, forever... so I didn't need to add anything to the installation.

I guess this will help with all versions of OS X from about 10.5 on up - which is when the paging system in OS X became slightly ridiculous. Give it a try and let us know after a few days of use, what you think.



Feb 08, 2013 at 01:57 AM
braindeadmac
Offline
• • •
Upload & Sell: On
p.1 #2 · Mac users with lots of RAM (Speed Up Tip)


Only problem with this is that the system will likely crash if it should need to do a page swap....And I don't really believe it makes that much of a performance difference if you aren't paging in/out. Certainly wouldn't recommend this on anyone running less than 20 or 24 GB RAM, and if you don any video rendering or other memory intensive tasks certainly avoid it altogether. Better yet, just put your system on a SSD. You can get a more than adequate SSD for $100 now that's big enough for a boot drive.


Feb 08, 2013 at 02:07 AM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #3 · Mac users with lots of RAM (Speed Up Tip)


I'll have to test that and see if it crashes with a full boat. I doubt it will tho. We're not turning off VM ya know. Just the idea that the OS has to unload memory pages to disk everytime we quit an app, or close a window, or move from image to image in some browsing facilities.

But if you have a Mac you ARE paging in/out all the frigging time. Just a few hours of use will give you millions of page-ins and thousands of page-outs. By the end of a day-long work session the figures are astronomical! So while it's true that there won't be a performance difference if you aren't paging in/out - everyone on the planet who has a Mac is... If yours isn't it's tuned off.

BTW, my boot drive is 1.5TB and over half full with about 800GB used. Just saying... But SSD is a good solution - to a completely different problem. It's not a solution for this AFAIK. Well, unless all your data drives are also SSD... And even then the speed ups for small files are no different. Even without an SSD we still have 64MB of drive cache RAM (per drive) which is the same speed or faster than an SSD. So for something like page-outs which is what we're talking about here, there's almost zero difference. SSDs are great for uncached I/O tho.




Feb 08, 2013 at 02:48 AM
hugowolf
Offline
• • •
Upload & Sell: Off
p.1 #4 · Mac users with lots of RAM (Speed Up Tip)


Bifurcator wrote:
I'll have to test that and see if it crashes with a full boat. I doubt it will tho. We're not turning off VM ya know. Just the idea that the OS has to unload memory pages to disk everytime we quit an app, or close a window, or move from image to image in some browsing facilities.

It would be a pretty lousy operating system if it did this. The only reason for writing a page back would be if it had been modified. If it hasn't been modified, then it already exists in the VM.

Brian A



Feb 08, 2013 at 03:07 AM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #5 · Mac users with lots of RAM (Speed Up Tip)


No one said Apple engineers were sane! OS X throws data pages (aka anonymous pages) into the swap files on disk in order to bring in more buffer cache pages, even when it should probably be preferring to leave them in RAM. Stuff like time machine, LR, image folder browsing, and etc. reads lots of disk pages into RAM and, in the process, kick out lots of data pages. When this happens applications can hang for a bit when they needed those data pages - until they can be brought back in from the swap files. It is NOT [exclusively] the case that when the number of pages on the free list falls below a threshold (determined by the size of physical memory), the pager attempts to balance the queues like one would expect a paging mechanism to behave. Instead, OS X is constantly moving inactive list entries over to the free list entries all the freaking time. App quits, window closes, even image slide show like allocations trigger the behavior. The result is that the end user can for example, open a folder of say, 500 images and have to wait about 5 seconds for all the icons to render, close the window, open another, and when they go back to the first one they still have to wait again for all the icons to update - again. With the dynamic pager unloaded from the kernel the second time the folder is opened the display is instant. And it stays that way for hours. It will eventually unload by other mechanisms but not in seconds or minutes as the dynamic pager does.




Edited on Feb 08, 2013 at 08:12 AM · View previous versions



Feb 08, 2013 at 03:56 AM
hugowolf
Offline
• • •
Upload & Sell: Off
p.1 #6 · Mac users with lots of RAM (Speed Up Tip)


So, it still doesn't have to write them back, just overwrite the frame or mark it as empty.

That cat and mouse avatar is more than mildly annoying.

Brian A



Feb 08, 2013 at 04:27 AM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #7 · Mac users with lots of RAM (Speed Up Tip)


Hehe... Yeah, I dunno exactly but I guess you got it right - with the dynamic pager turned off it just gets tagged as "inactive" and then overwritten by something that needs it whenever that happens. I do know that there are at least three kinds of VM in OS X. They even have a special name for their VM scratch file and system which implies the same. All I'm doing is unloading one of those from the stack. I forget what the other two are just now - I'll remember when I read it again. All three share the same disk-based file too BTW.

So I tried that 0-RAM thing to see if it would crash. It didn't.

I loaded PS and upsized a two layer image file to 2,800 megapixels. It was noticeably faster than usual. Maybe 3 or 4 times faster. Odd that - I dunno why. I guess it has something to do with the continuity of RAM with that dynamic pager turned off but that's only a guess.



And loaded a bunch of heavy-ish apps:



    PS: 2 layer 2,800 megapixel image opened,
    Safari: about 20 tabs opened with several on image threads and one (displayed) with about 120 images in it,
    iTunes: 2739 albums displayed and all icons cached,
    Mail: with over 1 million messages in the displayed DB,
    6 Finder windows each displaying cached icons for over 400 images (plus sidecars) each - all cached,
    Adobe Bridge: displaying 1,068 images,
    iPhoto: Displaying the mouse-over icon anims for about 180 albums.
    LR 4 (newest update): In develop mode pointed to a library of about 600 images,
    And Dashboard switched to with all those little applets loaded (about 16).


I then loaded "Hardware Monitor", set up a panel just monitoring Free Memory and started quitting applications. I waited a little bit to let things settle down although there were no signs that anything needed settling which is HIGHLY unusual for OS X (!!!) and looked at the VM profile that Menumeters shows:



Then I came here to write this and of this moment there is a tad over 4GB of RAM being used (Safari is being used (reopened) with those same 20 tabs open - and iTunes is still going because I dig this song too much to quit it). When OS X first starts up with everything I have added on it occupies about 3GB of RAM. And now any one of the apps or windows I just had opened will open instantly. I tried PS it took 4 seconds to load. I tried the finder window showing 1,068 images and all the icons were already rendered - the window expanded into view with the icons in place and the entire set of 1,068 images were all still cached.

And I should add that browsing and clicking around in the finder windows is suuuuper smooth right now. Normally had I done something like the above I would be making coffee waiting for the system to stabilize and hoping it didn't crash.



Feb 08, 2013 at 07:24 AM
cgardner
Offline
• • • • •
Upload & Sell: Off
p.1 #8 · Mac users with lots of RAM (Speed Up Tip)


I bought an early Aluminum iMac in 2006 with only 2GB of RAM and the 750MB internal HD died recently (likely from all the swaps). Time Machine prevented any loss of data.

When installing the new HD (quite simple) I also upgraded RAM to 6GB (max for that model) and noticed a drop in the page in / out and better performance because I was nearly always maxed out. before.

The amount of logging OSX does to disk is mind boggling. Firewall log also shows the OS regularly chatting with the mother ship for time and upgrade checks and the evil empire (Goggle / Akami) to see where I've been web surfing in the last 5 minutes. There might be some advantage to disconnecting from the network when doing photo editing.




Feb 08, 2013 at 01:15 PM
OntheRez
Offline
• • • •
Upload & Sell: On
p.1 #9 · Mac users with lots of RAM (Speed Up Tip)


Bifurcator,
Fascinating. I knew that OSX was swap hungry, but was unaware that it still dithered so much. I have a dim memory (it was a long time ago) that the NeXT engineers came up with a crazy swap algorithm so as to cram their complex interface into the tiny amount of RAM available back in the days when RAM was more valuable than gold. In thinking about it, I suppose itís entirely plausible that Appleís engineers never fundamentally changed it.

Odd how a company will get a blind spot about some part of its product and never change it. In the auto world my master mechanic brother reminds me that Ford canít make front ends, GM canít make transmissions, Dodge canít make brakes or for that matter durable suspensions, VW . . . Well he has a whole list.

I have noticed the delay in the first display of a image rich folder - though upon reopening it seems instantaneous. I have also noted that LR (which Iíve recently started using having finally given up on Aperture) hesitates upon module switch and does take a while to display images. Iíd written it off to Adobe (who no doubt have made some dubious programming choices over the years

Iíll give it a try as I also have 32GB RAM and mostly do image processing and writing (along with web and mail.)

Mr. Gardner, Iíve also noticed that the OS has become positively ďchattyĒ something Iím not enamoured with but donít think there is much we can do about it. Not only is the OS talking to Apple and Google all of the Adobe apps seem to need to ďtalk to momĒ on a regular basis. A lot of bandwidth bing p*ssed away, but then no one even seems to think about bandwidth anymore. Raises privacy questions in my mind also.

Robert



Feb 08, 2013 at 04:39 PM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #10 · Mac users with lots of RAM (Speed Up Tip)


Yeah, I haven't restarted my machine since I did so for that 0-RAM crash test and the image folder of 1,068 images (as well as everything else) is still cached even now, about 14 hours later. The amount of RAM in use always seems to return to around 4 or 5 GB after pretty much anything.



With Mail, iTunes, and 20 tabs in Safari, currently open.



Edited on Feb 08, 2013 at 09:03 PM · View previous versions


Feb 08, 2013 at 08:51 PM
 

Search in Used Dept. 



abqnmusa
Offline
• • • •
Upload & Sell: Off
p.1 #11 · Mac users with lots of RAM (Speed Up Tip)


One item to remember about OSX and Windows. If you have unused memory the OS will swap the portion of a HD/SSD that you are accessing. That speeds up tasks such as display of thumbnails, and generally gives you better performance. The more memory you add the more free memory the OS has for this swapping.

That may account for some of the swapping you are seeing.



Feb 08, 2013 at 08:53 PM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #12 · Mac users with lots of RAM (Speed Up Tip)


Yup! And what I'm turning off here is the OS's ability to unload many of those things back to disk - which it does all the time; even when no one with any sense would want it to.


Feb 08, 2013 at 08:57 PM
tomrock
Offline
• • •
Upload & Sell: On
p.1 #13 · Mac users with lots of RAM (Speed Up Tip)


hugowolf wrote:
That cat and mouse avatar is more than mildly annoying.

Brian A


My favorite thing about Firefox is that after a page has loaded, you can hit the escape key and it stops animated GIFs.



Feb 08, 2013 at 09:55 PM
rico
Offline
• • • •
Upload & Sell: Off
p.1 #14 · Mac users with lots of RAM (Speed Up Tip)


And with Adblock Plus, you can make those animated GIFs disappear forever. Ain't technology grand? BTW, I'm running Linux without swap space. 64GB of RAM is helpful that way.


Feb 09, 2013 at 03:44 AM
morganb4
Offline
• • • • •
Upload & Sell: Off
p.1 #15 · Mac users with lots of RAM (Speed Up Tip)


:-( I like the cat and mouse avatar



Feb 09, 2013 at 11:53 AM
OntheRez
Offline
• • • •
Upload & Sell: On
p.1 #16 · Mac users with lots of RAM (Speed Up Tip)


morganb4 wrote:
:-( I like the cat and mouse avatar


Actually, I'm waiting for his next version where a mutant mouse is bouncing the cat



Feb 09, 2013 at 05:23 PM
hugowolf
Offline
• • •
Upload & Sell: Off
p.1 #17 · Mac users with lots of RAM (Speed Up Tip)


tomrock wrote:
My favorite thing about Firefox is that after a page has loaded, you can hit the escape key and it stops animated GIFs.

Thanks for that I use FF and IE, and the escape key works in both. I can now actually read Bifrucator's posts.

Brian A



Feb 09, 2013 at 08:07 PM
jamesmorophoto
Offline
• • •
Upload & Sell: Off
p.1 #18 · Mac users with lots of RAM (Speed Up Tip)


I tried it, and everything is much snappier--like when I first got my SSD.

It makes sense. I've noticed photoshop hogging up excessive amounts of RAM when I leave it running in the background. This 'trick' just turns that off so that other ACTIVE apps can have priority.



Feb 11, 2013 at 04:48 AM
Bifurcator
Offline
• • • • •
Upload & Sell: On
p.1 #19 · Mac users with lots of RAM (Speed Up Tip)


Cool! I'm glad someone else tried it and likes it!

Now back to my evil laboratory where I'm busy force-feeding mice various grains from Fukushima.. Muaahahahaaaa



Feb 11, 2013 at 03:04 PM
lou f
Offline
• • • • •
Upload & Sell: Off
p.1 #20 · Mac users with lots of RAM (Speed Up Tip)


tomrock wrote:
My favorite thing about Firefox is that after a page has loaded, you can hit the escape key and it stops animated GIFs.


so it does :o)



Feb 12, 2013 at 11:19 PM
1
       2       end




FM Forums | Post-processing & Printing | Join Upload & Sell

1
       2       end
    
 

You are not logged in. Login or Register

Username   Password    Retrive password