4

Noticed today, Safari occasionally starts eating up memory until it reaches tens of gigabytes of memory used and freezes the whole system.

Safari memory leak

Both cases when this happened, the trigger was starting watching a video on youtube (using the HTML5 player). In Activity Monitor, no particular tab process shows high memory usage (not even the youtube ones), only the main Safari process. Closing tabs one by one does not stop the leak, even when all tabs are closed the main process continues gobbling up the memory. I have no extensions enabled (I disabled AdGuard after the first leak). I sampled the process during the second leak, but I'm not skilled enough to read the output (http://pastebin.com/MTxmEAQ4).

Any ideas how to fix this? I hate going back to Chrome, but this is unacceptable.

Thanks, O

  • You may not have any extensions, but do you have any plugins enabled? Check safari prefs -> security, plug-in settings. I vaguely recall running into something like this with GoToMeeting a few months back, but it couldn't hurt to make sure everything is turned off in there and trying again. – Mikey T.K. Feb 13 '17 at 16:30
  • Another thing to try - open up Terminal, and run leaks against Safari's PID. You'll get a lot of spew and it will take a while, but it may reveal where the leak is coming from. – Mikey T.K. Feb 13 '17 at 16:36
  • @MikeyT.K. No plugins installed, browser is stock version. Thanks for the "leaks" tip, didn't knew about this command. – Ovidiu Roșoiu Feb 14 '17 at 8:39
1

Time for the Standard Mac App Troubleshooting Steps™

0) Turn off all plugins/extensions

You did this already :)

1) Trash the preferences for the app

You said that you're using stock everything, so this shouldn't result in too much trouble.

Shut down Safari, then open a Finder window, hit cmd-shift-G, and enter ~/Library/Safari. Move the entire contents of this folder somewhere else, either into your trash can or a folder on the desktop.

This will probably solve the problem. Safari is probably choking on something like the history database or some other bit of nonessential stored data.

Start it back up. Problem still exist? Close it down, then:

2) Verify the disk

Sounds trite, but this can cause Weird Stuff to happen. Go to Applications → Utilities → Disk Utility, click on your main hard disk, and select First Aid on the menubar. Let the process run. Did it fix any errors? If not...

3) New user profile

Not quite the nuclear option - but in short, make a new user account and see if Safari behaves the same on that account. Everything should be clean here, and this shouldn't happen.

If it does, something on the system is very, very broken, and you'd need to look into:

4) Recovery install

We've now determined something on the system is trashed. Back up your data and programs, then reboot your machine holding r after the chime, and reinstall Mac OS.

  • Hi Mike, Thanks for taking the time to write this. I already did the first two steps with no luck, and unfortunately wiping my profile or reinstalling the OS is a no go. The easier solution for me was to migrate to Chrome. – Ovidiu Roșoiu Mar 23 '17 at 12:53
  • You don't have to wipe your profile - just make a new user account and see if the problem happens there. This helps isolate the problem. – Mikey T.K. Mar 23 '17 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .