linux-app icon indicating copy to clipboard operation
linux-app copied to clipboard

High memory usage after several hours of use

Open brendenhoffman opened this issue 3 years ago • 35 comments

I am using arch with the app installed through the chaotic aur. I started the app roughly around 3pm yesterday, put the pc to sleep at 5:30pm, and at 9am the next morning protonvpn was using 1.8GB of ram. I did use some intense webpages, such as reddit, youtube, and outlook webmail, but at the time I was running out of memory my browser was only using a little under 500mb on my current tab, which was outlook during a refresh. My pc only has a little over 5gb of ram, so I really can't afford to have programs taking up so much memory. On a bit of a side note, I used to use the cli app, but recent builds have made the cli and gui conflicting packages, at least when using the precompiled binaries from the chaotic aur. I don't think this was an issue when I was using the cli app through a script to autostart it.

brendenhoffman avatar Oct 13 '21 14:10 brendenhoffman

Reported here on Reddit also.

Jakethethird avatar Oct 14 '21 05:10 Jakethethird

Hey @Jakethethird

It's something that we're aware of and are working on.

calexandru2018 avatar Oct 14 '21 20:10 calexandru2018

Yeah I found the app had increased to 4GB usage today after putting my laptop to sleep yesterday.

Victor239 avatar Oct 15 '21 06:10 Victor239

Hi @calexandru2018,

I've been monitoring the releases waiting for a patch. The changelog for version 1.5 mentions the memory leak has been resolved.

This does seem better, I unfortunately do not have the measurements from last week but at some point it was sitting at close to 1.5GB last week after a couple of hours. Unfortunately it does seem that there is still some leakage happening on the gui app.

Started the gui app after a clean restart took htop measurement and roughly 1h20 later checked again and memory usage was up from 190MB to 350MB.

image

image

image

This is on Manjaro using kernel 5.14.13 and kde plasma 5.23.1

nlynzaad avatar Oct 25 '21 20:10 nlynzaad

Hey @dragonhelios

thanks for the feedback. So before the patch the GUI would start at around 440Mb and after 1h consumer around 1Gb of RAM. This new patch makes so that the GUI starts at around 140Mb and after 1h hover at around 300Mb.

well be closely monitoring the situation to understand if there are anymore such spikes of high RAM usage. As of now there shouldn’t be.

calexandru2018 avatar Oct 25 '21 20:10 calexandru2018

thanks. I will advise if anything out of the ordinary appears.

nlynzaad avatar Oct 25 '21 20:10 nlynzaad

Issue is definitely still there, although as mentioned before it is much better, after having the app running now for 2 days and 20 hours and intermittently connecting and disconnecting memory usage is sitting at 1.35GB.

nlynzaad avatar Nov 08 '21 16:11 nlynzaad

Hello, Unsure of current status of this issue but I wanted to note that I am also seeing high RAM usage with the GUI app--currently experiencing 1.5 GB of usage after 5 day's uptime.

ProtonVPN: v1.7.0 (library: v3.8.0 / api-client: v0.7.1)

asorel1942 avatar Apr 22 '22 18:04 asorel1942

Same here. I think this app should be in Rust. If it still has memory leaks then probably it has memory vulnerabilities. Also I don't know why it does so much disk reads and writes, it should do none.

Also, why it takes literally 2 minutes to load the VPNs when I boot my PC?

lzunsec avatar May 17 '22 20:05 lzunsec

ProtonVPN: v1.8.0 (library: v3.9.0 / api-client: v0.7.1)

ubuntu 22.04

my suggestions: change this app to Rust and use flutter instead of GTK

lzunsec avatar May 17 '22 20:05 lzunsec

my suggestions: change this app to Rust and use flutter instead of GTK

Rust sounds good but Flutter... no. Flutter uses GTK for Linux, so what would that solve? Nothing. A simple webview with something like Tauri for your frontend is more than sufficient.

CodeDead avatar May 27 '22 23:05 CodeDead

Flutter uses GTK just for rendering the opengl stuff. Tauri would consume a lot of RAM. Flutter is very very modern for graphics, with 60fps animations, and I believe Proton is redesigning and wants to looks beautiful. Please, no JavaScript, no webview, no 500mb ram just for displaying a web interface.

That's why Canonical is moving to Flutter, it's the best option.

-------- Mensagem Original -------- Ativo 27 de mai. de 2022 20:26, CodeDead escreveu:

my suggestions: change this app to Rust and use flutter instead of GTK

Rust sounds good but Flutter... no. Flutter uses GTK for Linux, so what would that solve? Nothing. A simple webview with something like Tauri for your frontend is more than sufficient.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lzunsec avatar May 27 '22 23:05 lzunsec

Flutter uses GTK just for rendering the opengl stuff. Tauri would consume a lot of RAM. Flutter is very very modern for graphics, with 60fps animations, and I believe Proton is redesigning and wants to looks beautiful. Please, no JavaScript, no webview, no 500mb ram just for displaying a web interface. That's why Canonical is moving to Flutter, it's the best option. -------- Mensagem Original -------- Ativo 27 de mai. de 2022 20:26, CodeDead escreveu:

my suggestions: change this app to Rust and use flutter instead of GTK Rust sounds good but Flutter... no. Flutter uses GTK for Linux, so what would that solve? Nothing. A simple webview with something like Tauri for your frontend is more than sufficient. — Reply to this email directly, [view it on GitHub](#49 (comment)), or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Tauri doesn't consume a lot of RAM. Tauri is probably the most performant option and you do not need to write a single line of JavaScript to get it to work. I think you might want to look into it first: https://tauri.studio/

Anyway, neither of us are the developers of this project and ProtonVPN is a private company, they can do whatever they like with their project.

CodeDead avatar May 27 '22 23:05 CodeDead

I agree, Tauri is not bad, but still Flutter is faster and consumes much less RAM. And web is not meant for apps so it makes sense to use a solution that will work everywhere and with the least amount of ram. It's sad that RAM always grows but apps always keep up with the usage, so we can never win.

-------- Mensagem Original -------- Ativo 27 de mai. de 2022 20:32, CodeDead escreveu:

Flutter uses GTK just for rendering the opengl stuff. Tauri would consume a lot of RAM. Flutter is very very modern for graphics, with 60fps animations, and I believe Proton is redesigning and wants to looks beautiful. Please, no JavaScript, no webview, no 500mb ram just for displaying a web interface. That's why Canonical is moving to Flutter, it's the best option. -------- Mensagem Original -------- Ativo 27 de mai. de 2022 20:26, CodeDead escreveu:

my suggestions: change this app to Rust and use flutter instead of GTK Rust sounds good but Flutter... no. Flutter uses GTK for Linux, so what would that solve? Nothing. A simple webview with something like Tauri for your frontend is more than sufficient. — Reply to this email directly, [view it on GitHub](#49 (comment)), or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Tauri doesn't consume a lot of RAM. Tauri is probably the most performant option and you do not need to write a single line of JavaScript to get it to work. I think you might want to look into it first: https://tauri.studio/

Anyway, neither of us are the developers of this project and ProtonVPN is a private company, they can do whatever they like with their project.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lzunsec avatar May 27 '22 23:05 lzunsec

...but still Flutter is faster and consumes much less RAM.

Can I ask what benchmarks you base this on @lzunsec ?

CodeDead avatar May 27 '22 23:05 CodeDead

The only reason tauri has a smaller build size than electron or even flutter is because it uses the native browser, but the amount of crazy JS frameworks you have to insert to make something work is enormous so the RAM grows really fasy. But a fresh flutter app already has half the ram consumption, and comes with all the frameworks for animations and etc https://github.com/Elanis/web-to-desktop-framework-comparison. Once you add the equivalent in Tauri you get a slack-like app with 100s of mb of consumption for a simple chat app.

Also Flutter uses GTK on Linux just as a opengl display, so no GTK weirdness or anything needed

-------- Mensagem Original -------- Ativo 27 de mai. de 2022 20:38, CodeDead escreveu:

...but still Flutter is faster and consumes much less RAM.

Can I ask what benchmarks you base this on @.***(https://github.com/lzunsec) ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

lzunsec avatar May 27 '22 23:05 lzunsec

You don't need to add or write JS or use JS frameworks in Tauri. Rust is sufficient. It has the option to work with JavaScript, but it is not required.

In addition, the comparison you provided is incomplete.

CodeDead avatar May 27 '22 23:05 CodeDead

I just dropped this into the reddit thread as well: I believe this locked up my computer today pretty hard... ssh in a pkill all the protonvpn processes (why were like 7?) and then I was able to get back in...

OS: Pop_OS! 22.04

ProtonVPN GUI Client: v1.12.0 (library: v3.14.0 / api-client: v0.7.1)

pypeaday avatar Dec 09 '22 16:12 pypeaday