Skip to content

using PA on firefox with ollama / gemma3 causes severe memory leak #516

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

Open
lands39 opened this issue Mar 20, 2025 · 18 comments
Open

using PA on firefox with ollama / gemma3 causes severe memory leak #516

lands39 opened this issue Mar 20, 2025 · 18 comments
Labels
bug Something isn't working

Comments

@lands39
Copy link

lands39 commented Mar 20, 2025

when using page assist to talk to gemma3 running on ollama, a severe memory leak occurs and i've observed firefox using upwards of 17 gigs of RAM, rendering my system completely unusable as ollama is filling up the rest of my RAM. this does not happen when interacting with other models. system has 32 gigs of RAM.

@n4ze3m n4ze3m added the bug Something isn't working label Mar 20, 2025
@n4ze3m
Copy link
Owner

n4ze3m commented Mar 20, 2025

Hey, sorry about the issue 😐. Does this happen with other models or just with Gemma 3?

@n4ze3m
Copy link
Owner

n4ze3m commented Mar 20, 2025

Also, does this issue occur when using the Chrome or Edge version of Page Assist ?

@lands39
Copy link
Author

lands39 commented Mar 20, 2025

Hi! This only seems to happen with gemma3 but i've also noticed similar behavior when enabling web search on other models to a lesser extent. I also tried PA in supermium 126 (chromium fork) on a windows VM and it doesn't seem to happen over there, its quite bad on firefox 136.01 on windows though. have not tested linux yet.

@zztop007
Copy link

@lands39 Latest Ollama?

@lands39
Copy link
Author

lands39 commented Mar 20, 2025

yes

@lands39
Copy link
Author

lands39 commented Mar 21, 2025

did some testing with gemma and page assist on linux, everything seems fine so perhaps this is an issue specifically with windows and firefox

@lands39
Copy link
Author

lands39 commented Mar 21, 2025

i've run into another issue on firefox: when deleting old chats, it would always give me a confirmation prompt, but also had a box that siad "don't prompt me about this again". i checked the box thinking it would not ask to confirm anymore, and when i tried to delete chats, chats would not delete. i uninstalled the plugin, reinstalled it and now new chats don't appear under history unless i restart firefox. deleting works again though.

@lands39
Copy link
Author

lands39 commented Mar 21, 2025

okay, restarted ollama, cleared cache and that fixed the above, memory leak does still happen though

@hackerjsimon
Copy link

Same issue with firefox. it uses all my base ram, But doesn't really touch my GPU's VRAM at all, even with the GPU layers set to 1

@lands39
Copy link
Author

lands39 commented Mar 28, 2025

is there a way i could provide logs or more in-depth information on this? would love to see this get fixed. currently as a workaround i'm running ollama on my pc and the browser plugin on another system.

@n4ze3m
Copy link
Owner

n4ze3m commented Mar 29, 2025

Hey @lands39 , both Chrome and Firefox implementations are the same, but I don't know why it's causing a memory leak when using the Gemma model on Firefox.

If you're okay with it, could you try running it on Firefox Nightly to see if there's an issue?

I found a few reports on Bugzilla about memory leaks with extensions.

For example: https://bugzilla.mozilla.org/show_bug.cgi?id=1932080

@lands39
Copy link
Author

lands39 commented Mar 29, 2025

sure, i can try this in the morning. i have a windows VM with nightly already installed so i'll try on there too and see what it does

@n4ze3m n4ze3m pinned this issue Mar 30, 2025
@lands39
Copy link
Author

lands39 commented Mar 30, 2025

doesn't appear to happen when connecting to a remote ollama instance on nightly from my windows 11 VM, and testing locally with nightly doesn't seem to do it. i also tried copying over my firefox profile and i can't trigger the issue either, but when installing the page assist plugin firefox / explorer? did kinda freak out for a second.

@lands39
Copy link
Author

lands39 commented Mar 30, 2025

i updated my normal firefox install to 136.0.4 and it seems to be behaving as expected, when i ask gemma3 to analyze an image firefox does spike by 1 - 2 gigs after the prompt finishes generating, but this quickly drops back to normal. i'll do further testing and see what happens

@n4ze3m
Copy link
Owner

n4ze3m commented Mar 30, 2025

Thanks for the response. From what I understand in the Gemma 3 technical report, Gemma 3 uses a vision encoder called SigLIP when processing input. I think Ollama does not load it into memory if we are not using images, which is why there is a spike. Maybe I’m wrong

@lands39
Copy link
Author

lands39 commented Apr 6, 2025

it seems the issue is still here, firefox leaked so bad my commit charge went up to 70 gigs

Image

@n4ze3m
Copy link
Owner

n4ze3m commented Apr 6, 2025

The latest version is currently under review at the add-on store. Once it's approved, the issue will hopefully be resolved.

@lands39
Copy link
Author

lands39 commented Apr 18, 2025

did the new version come out? it seems to still have issues, interestingly when i cleared my history firefox had a bad memory leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants