Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected memory usage spike soon after launch #3231

Open
meldra opened this issue Sep 7, 2024 · 5 comments
Open

Unexpected memory usage spike soon after launch #3231

meldra opened this issue Sep 7, 2024 · 5 comments

Comments

@meldra
Copy link

meldra commented Sep 7, 2024

I installed the browser (Version 1.104.0 (251)) on my MBP 14" M1 (Sonoma 14.6.1 (23G93)) for the first time yesterday to check it out, which I've been meaning to do for a while now. After poking around for a while (I forget which settings I changed, sorry) I opened Activity Monitor and saw that the browser had hoarded a bunch of memory, pushing the memory pressure graph into the yellow range, so I closed it.

I have (repeatedly) run a simple test to reliably reproduce this.

  1. Opened Activity Monitor.
  2. Opened the browser. Do not open tabs or anything. Just let it sit.
  3. Observe the Memory tab in Activity Monitor, specifically the DuckDuckGo row.
  4. Closed the browser completely.

Expected behavior:

I have run the same test on an old HP core-i5 on Windows 10 22h2 and it peaked at 600-something MB of memory before dropping back under 500MB. This is more like what I expected.

Actual behavior:

Between 10 seconds and up to a minute after step 2, the memory allocation began to increase dramatically then plateaued briefly at around 4GB. After a short while, about a GB of memory was released over the span of 20 or more seconds before the browser grabbed more, ballooning to as much as 13.5GB (and likely would have gone higher.)

Eventually, the browser releases some of the memory by itself going back down to around 7GB (which is still too much!) It'll hold on to those 7GB even if you close all tabs. The more times you run the test, the quicker it releases this memory. I guess because it has less competition for that memory soon after releasing it, and can get the cause of this over and done with sooner.

The memory was only fully released after step 4.

@samsymons
Copy link
Collaborator

@meldra Thanks for raising this, and thanks for such a detailed report! 🙏

I ran this test locally and wasn't able to reproduce it out of the box (memory usage is stable at around 150MB for me), so I'm now interested in figuring out what's different between our setups such that this issue would manifest. I'll do some memory leak investigation this week, but for now I have some quick questions:

  1. You mentioned this in step 2, but just to confirm: this was without any webpages at all open, correct?
  2. Did you have the sync feature enabled?
  3. Did you have the VPN enabled?
  4. Do you have any bookmarks or favorites?

@meldra
Copy link
Author

meldra commented Sep 9, 2024

1. You mentioned this in step 2, but just to confirm: this was without any webpages at all open, correct?

Happens with or without pages or additional tabs open. I do note that the longer I tested this for, the slower the spike took to happen. The report is detailed because every time I reproduced a prior assumption got challenged :)

2. Did you have the sync feature enabled?

No it's not. It's still offering me the "sync with another device" button.

3. Did you have the VPN enabled?

I do not have privacy pro, no. The protections pane has:

  • default browser, off
  • private search, on
  • web tracking protection, on
  • cookie pop-up protection, on
  • email protection, off

In case there is any - albeit unlikely - chance of this being relevant, I am connected to a wireguard vpn. iCloud private relay is off.

4. Do you have any bookmarks or favorites?

Just what I agreed to import from firefox, which is actually literally just the default firefox stuff. I'm that kind of weirdo that doesn't typically bookmark or favorite things.

@meldra
Copy link
Author

meldra commented Sep 9, 2024

After leaving the browser open all night, its memory footprint dropped to 350ish mb and this no longer happens at launch.

@meldra
Copy link
Author

meldra commented Sep 9, 2024

Ok I've purged and reinstalled.

It's not reproducing, but I also didn't get the click-through tutorial thingy. Where's it saving that state?

edit: Freshly reinstalled memory usage sitting at half of what it was before reinstall.

@meldra
Copy link
Author

meldra commented Sep 20, 2024

I did eventually figure out where to remove the cache. However, I have not been able to reproduce this issue at all since. If you didn't find a memory leak, probably best to call it an edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants