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

Safari continually increasing memory usage until there is no more...

Hello,


I am having a vexing problem with Safari that is making me really frustrated. Just to get my specs out of the way: Work-issued mid-2012 Macbook Pro, 16GB RAM, on Safari v 6.0, running Lion (work is slow to allow us to upgrade OSs till they thoroughly check it all out). Safari extensions running: Buffer, Unsocialize, Add to Amazon wishlist, Evernote web clipper, Feedly, Shortly, Pocket. None of these were recently added - all had been installed and running before this problem started.


Ok so I typically have 15-20 tabs open, mostly text-based ones, sometimes a video or 2, and facebook. I have in the past on machines with a fraction of the power of this one had 80-100 tabs open no problem....Anyway so now whenever I start a new session I usually have at least 7-8GB RAM free (I usually have activity monitor open especially since I've been having these issues). Other apps usually running = Mail, Spotify, Notational Velocity, Twitter, all running stabily at low RAM usage. MS Office running when using them only.


Then over time (now less than an hour), without opening any more tabs or even while closing the ones I am done with, the memory usage creeps up until all 16GB are used up (usually gets to 10-20MB free then spinning ball)....then I force quit safari and start this over. Now this loop is happening 4-5 times a day on average, sometimes more if I'm online more. Even if I just sit at my computer and do nothing with the trackpad or keyboard (ie just watch activity monitor), Safari memory usage increases steadily. Rebooting does not help at all.


What can I do? Can I reinstall Safari?

MacBook Pro, Mac OS X (10.7.4), Work Mid-2012 MBP

Posted on Dec 29, 2013 11:33 AM

Reply
1 reply

Dec 29, 2013 1:17 PM in response to flutesUD

If you don't already have a current backup, back up all data before doing anything else. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve your problem. The backup is necessary on general principle, not because of anything suggested in this comment. There are ways to back up a computer that isn't fully functional. Ask if you need guidance.

Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The procedure will help identify which such modifications you've installed, as well as some other aspects of the configuration that may be related to the problem.

Don’t be alarmed by the seeming complexity of these instructions — they’re easy to carry out. Here's a brief summary: In each of two steps, you copy a line of text from this web page into a window in another application. You wait about a minute. Then you paste some other text, which will have been copied automatically, back into a reply on this page. The sequence is copy; paste; paste again. That's all there is to it. Details follow.

You may have started the computer in "safe" mode. Preferably, these steps should be taken while booted in “normal” mode. If the system is now running in safe mode and is bootable in normal mode, reboot as usual. If it only boots in safe mode, use that.

Below are instructions to enter UNIX shell commands. They do nothing but produce human-readable output. However, you need to think carefully before running any program at the behest of a stranger on a public message board. If you question the safety of the procedure suggested here — which you should — search this site for other discussions in which it’s been followed without any report of ill effects. If you can't satisfy yourself that these instructions are safe, don't follow them.

The commands will line-wrap or scroll in your browser, but each one is really just a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it.

If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. Step 1 should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply.

Launch the Terminal application in any of the following ways:


☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.


When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign.


Step 1


Triple-click anywhere in the line of text below on this page to select it:

PB=/usr/libexec/PlistBuddy; PR () { [[ "$o" ]] && printf '\n%s:\n\n%s\n' "$1" "$o"; }; PC () { o=$(grep [^[:blank:]] "$2"); PR "$1"; }; PF () { o=$($PB -c Print "$2" | awk -F'= ' \/$3'/{print $2}'); PR "$1"; }; PN () { [[ $o -eq 0 ]] || printf "\n%s: %s\n" "$1" $o; }; { system_profiler SPSoftwareDataType | sed '8!d;s/^ *//'; o=$(system_profiler SPDiagnosticsDataType | sed '5,6!d'); fgrep -q P <<< "$o" && o=; PR "POST"; o=$(( $(vm_stat | awk '/Pageo/{sub("\\.",""); print $2}')/256 )); [[ $o -gt 1024 ]] && printf "\nPageouts: %s MiB\n" $o; s=( $(sar -u 1 10 | sed '$!d') ); [[ ${s[4]} -lt 90 ]] && o=$( printf 'User %s%%\t\tSystem %s%%' ${s[1]} ${s[3]} ) || o=; PR "Total CPU usage"; [[ "$o" ]] && o=$(ps acrx -o comm=Process,ruid=User,%cpu | sed 's/ */:/g' | head -6 | awk -F: '{ printf "%-10s\t%s\t%s\n", $1, $2, $3 }'); PR "CPU usage by process"; o=$(kextstat -kl | grep -v com\\.apple | cut -c53- | cut -d\< -f1); PR "Loaded extrinsic kernel extensions"; o=$(launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'); PR "Loaded extrinsic user agents"; o=$(launchctl getenv DYLD_INSERT_LIBRARIES); PR "Inserted libraries"; PC "cron configuration" /e*/cron*; o=$(crontab -l | grep [^[:blank:]]); PR "User cron tasks"; PC "Global launchd configuration" /e*/lau*; PC "Per-user launchd configuration" ~/.lau*; PF "Global login items" /L*/P*/loginw* Path; PF "Per-user login items" L*/P*/*loginit* Name; PF "Safari extensions" L*/Saf*/*/E*.plist Bundle | sed 's/\..*$//;s/-[1-9]$//'; o=$(find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l); PN "Restricted user files"; cd; o=$(find -L /S*/L*/E* {,/}L*/{A*d,Compon,Ex,In,Keyb,Mail/Bu,P*P,Qu,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do ID=$($PB -c 'Print :CFBundleIdentifier' "$d/Info.plist") || ID=; ID=${ID:-No bundle ID}; egrep -qv "^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|JMicron|microsoft\.MDI|print|SoftRAID" <<< $ID && printf '%s\n\t(%s)\n' "${d%/Contents}" "$ID"; done); PR "Extrinsic loadable bundles"; o=$(find /u*/{,*/}lib -type f -exec sh -c 'file -b "$1" | grep -qw shared && ! codesign -v "$1"' {} {} \; -print); PR "Unsigned shared libraries"; o=$(system_profiler SPFontsDataType | egrep "Valid: N|Duplicate: Y" | wc -l); PN "Font problems"; for d in {,/}L*/{La,Priv,Sta}*; do o=$(ls -A "$d"); PR "$d"; done; } 2> /dev/null | pbcopy; echo $'\nStep 1 done'


Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste ( command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.

The command may take up to a few minutes to run, depending on how many files you have and the speed of the computer. Wait for the line "Step 1 done" to appear below what you entered. The output of the command will be automatically copied to the Clipboard. All you have to do is paste into a reply to this message by pressing command-Vagain. Please don't copy anything from the Terminal window. No typing is involved in this step.

Step 2


Remember that you must be logged in as an administrator for this step. Do as in Step 1 with this line:

PR () { [[ "$o" ]] && printf '\n%s:\n\n%s\n' "$1" "$o"; }; { o=$(sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|calendarse|cups|dove|isc|ntp|post[fg]|x)/{print $3}'); PR "Loaded extrinsic daemons"; o=$(sudo defaults read com.apple.loginwindow LoginHook); PR "Login hook"; o=$(sudo crontab -l | grep [^[:blank:]]); PR "Root cron tasks"; o=$(syslog -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|find tok|n Cause: -|NVDA\(|pagin|timed? ?o' | tail -n25 | awk '/:/{$4=""; print}'); PR "Log check"; } 2>&- | pbcopy; echo $'\nStep 2 done'

This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.

You can then quit Terminal. Please note:

☞ Steps 1 and 2 are all copy-and-paste — type only your login password when prompted.

When you type your password, you won't see what you're typing.

☞ If you don’t have a password, set one before taking Step 2. If that’s not possible, skip the step.

☞ Step 2 might not produce any output, in which case the Clipboard will be empty. Step 1 will always produce something.

☞ The commands don't change anything, and merely running them will do neither good nor harm.

☞ Remember to post the output. It's already in the Clipboard. You don't have to copy it. Just paste into a reply

☞ If any personal information, such as your name or email address, appears in the output of either command, anonymize it before posting. Usually that won't be necessary.

Don't post what you see in the Terminal window. The output is copied automatically to the Clipboard.

Don't paste the output of Step 1 into the Terminal window. Paste it into a reply.

Safari continually increasing memory usage until there is no more...

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