11

Huge safari memory leak

 3 years ago
source link: https://forums.macrumors.com/threads/huge-safari-memory-leak.2268183/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Huge safari memory leak

Got a tip for us? Let us know

ferdi2005

macrumors newbie

Original poster

Jul 13, 2018
After I updated to Big Sur, Safari is having an huge memory leak on my MacBook pro 16 ! I'm The system asked me to close it because RAM was ending. (showing an unrealistic 106 GB because I have only 16 GB of RAM, but it asked me to close it!). I tried to disable extensions but nothing changed and it's gaining more and more RAM. I just started it up and opened three tabs and it ate 3 GB of RAM!
Any ideas?
Schermata 2020-11-14 alle 16.51.49.png

Trepanator

macrumors newbie
Oct 21, 2008
I have been using internal betas of Safari 14 from Catalina and I have seen the same sorts of issues. Experimentally, I have found that disabling the stupid new "Start Page" feature goes a helps to correct the issue. After configuring the browser to open new tabs as blank pages, I am seeing lower memory usage.

chris4565

macrumors 6502a
Sep 22, 2018
Also having this issue. I completely quit Safari, browsed the internet for 2 hours and this is the memory usage after the 2 hours (it constantly climbed up):

Safari is using almost 20 GB even though I just have 8 GB of RAM. I think this is possible due to virtual RAM but Safari shouldn’t use this much RAM

IowaLynn

Contributor
Feb 22, 2015 1,870
Use option to launch Safari without extensions. Also try turning off apps that launch on startup / login.

ferdi2005

macrumors newbie

Original poster

Jul 13, 2018
@IowaLynn
Use option to launch Safari without extensions. Also try turning off apps that launch on startup / login.
Tried many times without success.

volzkzg

macrumors newbie
Nov 4, 2017
Also happened to me. It's quite easy to reproduce on my side, simply open several google pages and close it, the memory will keep increasing. After some trials, it turns out to be related to the ad blocker extension - 1Blocker. When I disable it, the memory leak issue resolved.

chris4565

macrumors 6502a
Sep 22, 2018
EDIT: Oopsie, you were a bit faster

Ok, here's what I found out. I THINK that the issue is the extension 1Blocker (unfortunately this probably isn't the solution for you since you tried to launch Safari without extensions but maybe it helps someone else). Here was my test procedure.

One note beforehand: To monitor the RAM usage I used iStat Menus. iStat Menus always gives me a way higher Safari memory usage compared to the Safari entry in the activity monitor. I think this is because iStat Menus shows multiple Safari entries combined (e. g. there are also entries called "Safari web content (in cache)" in the activity monitor).

1.) Completely quit Safari
2.) Launch Safari, watch heavy 4K/60 clip
3. [See Safari memory usage with iStat Menus]
4.) Go on some websites
5.) [See Safari memory usage]
6.) Quit Safari (but NOT completely, so just click the red X)
7.) [See Safari memory usage]

WITH 1Blocker X, after the video the usage was at around 2 GB, climbed to 2.5 while surfing on some websites and now the very interesting part: When I quit Safari with the red X the usage stayed about the same BUT: In the activity monitor Safari was listed with hundreds of MB (<-- I will come back to this fact later).

WITHOUT 1Blocker X, after the video the usage was at around 1 - 1.5 GB and stayed there while surfing on some websites and when I quit Safari with the red X the Safari entry itself showed just a usage of around 160 MB (+ some "Safari web content (in cache)" entries with a few hundred MB each.

So it seems like with 1Blocker the used RAM doesn't get freed somehow.

Reactions: volzkzg

ferdi2005

macrumors newbie

Original poster

Jul 13, 2018
So, for small periods me the difference is small with or without 1Blocker and other extensions: Safari continues to leak memory but it doesn't leak memory on a fresh user! If I use it for a longer period of time, with 1Blocker the memory leak situations explodes, without it, the memory usage remains exaggerate (way more than 1.5 GB) but it's less.

Thank you all really much for your help, let's remain in contact and understand how to fix.
EDIT: Oopsie, you were a bit faster

Ok, here's what I found out. I THINK that the issue is the extension 1Blocker (unfortunately this probably isn't the solution for you since you tried to launch Safari without extensions but maybe it helps someone else). Here was my test procedure.

One note beforehand: To monitor the RAM usage I used iStat Menus. iStat Menus always gives me a way higher Safari memory usage compared to the Safari entry in the activity monitor. I think this is because iStat Menus shows multiple Safari entries combined (e. g. there are also entries called "Safari web content (in cache)" in the activity monitor).

1.) Completely quit Safari
2.) Launch Safari, watch heavy 4K/60 clip
3. [See Safari memory usage with iStat Menus]
4.) Go on some websites
5.) [See Safari memory usage]
6.) Quit Safari (but NOT completely, so just click the red X)
7.) [See Safari memory usage]

WITH 1Blocker X, after the video the usage was at around 2 GB, climbed to 2.5 while surfing on some websites and now the very interesting part: When I quit Safari with the red X the usage stayed about the same BUT: In the activity monitor Safari was listed with hundreds of MB (<-- I will come back to this fact later).

WITHOUT 1Blocker X, after the video the usage was at around 1 - 1.5 GB and stayed there while surfing on some websites and when I quit Safari with the red X the Safari entry itself showed just a usage of around 160 MB (+ some "Safari web content (in cache)" entries with a few hundred MB each.

So it seems like with 1Blocker the used RAM doesn't get freed somehow.

chris4565

macrumors 6502a
Sep 22, 2018
Thank you all really much for your help, let's remain in contact and understand how to fix.
Sure, just so you know: I contacted Alex from 1Blocker support and he's super nice and supportive. I've already contacted him for issues in the past and they have always been resolved. I will keep you all updated on the situation.

chris4565

macrumors 6502a
Sep 22, 2018
By the way, this is how it looks now that I've disabled the extension. As can be seen, the Safari usage itself it very low (200 MB) but I see multiple items for cached Safari content:
So, for small periods me the difference is small with or without 1Blocker and other extensions: Safari continues to leak memory [...]
Yup, I can confirm this. I checked with iStat Menus and indeed, so far at least, the memory also climbs up even though I have the extension disabled but nowhere near as fast (iStat Menus shows around 3 GB now). I think it climbs up because of the cached content entries in the activity monitor since Safari itself still uses only 200 MB so the rest (2.8 GB) have to be the cached content I think.

Reactions: ferdi2005

e.clinton

macrumors newbie
Aug 31, 2020
I don't have 1Blocker installed and I see the same issue on 2019 MBP 16. I was lucky to grab this screenshot yesterday.. today it just freezes the computer completely and needs a hard reset.
Screen Shot 2020-11-16 at 11.31.49 AM.png

chris4565

macrumors 6502a
Sep 22, 2018
Thank you all really much for your help, let's remain in contact and understand how to fix.
Okay, so as promised, here's an update: Alex from 1Blocker support got back to me Here are a few notes:

- He confirms that there's a memory leak in the current version of Safari but it is not clear yet if it is caused by 1Blocker or the browser itself.
- They are investigating the issue right now and will fix it asap once they figure out why it happens

And great news: He told me that disabling the 1Blocker Button extension in Safari > Preferences > Extensions fixes the problem. And from some short testing I can indeed say that this fixes the issue for me. Content still gets blocked, just the 1Blocker button is missing.

I hope this helps others who also have this issue.

Have a great day everyone.

Reactions: mirv

chris4565

macrumors 6502a
Sep 22, 2018
Another update: The 1Blocker team just released an update to fix the memory leak issue by reverting back to the blue 1Blocker button in Safari as a temporary workaround. Apparently, the monochrome one caused the issues.

Reactions: Quackers

hello(again)

macrumors newbie

Nov 25, 2020

Aurora, CO

May I bump this? I have ZERO extensions and am noticing the Safari cache gets HUGE in Activity Monitor. I know how to clear the cache manually through the Develop button, but I wish safari could do that every time I close it out. I'm not having luck finding any apps that *confirmed* can do this automatically... has anyone found one that does that yet? Plenty of ad blockers and stuff, but I just wish the cache would clear every time I close Safari. Thanks

rasputin666

macrumors regular
Mar 1, 2009
1609477151423.png
i have a 2013 mac pro. 12 cores. 128gb ram. all i have is safari open with a few tabs. nothing special on the tabs. never happens when i use chrome. only safari. doesn't make sense to me.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK