evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.74k stars 498 forks source link

CPU and memory usage goes up in time #236

Closed cccaballero closed 3 years ago

cccaballero commented 5 years ago

Installed in Ubuntu 18.04, and the CPU and RAM usage is increasing in time, I think there is a memory leak or something similar.

britzke commented 5 years ago

I noticed the same on Ubuntu 18.10 with 4GB of RAM. It is taking 60% of it after 24 hours.

zero77 commented 5 years ago

I am getting the same in Ubuntu 18.04.1 but, as a temporary fix i restart the service which helps for a while.

CrashTD commented 5 years ago

Can confirm on Manjaro (4.19.24). CPU is okay but RAM goes up massive. After a while it cross 2 GB. Makes it unfortunately unusable at the moment.

itszaen commented 5 years ago

Also the same on Arch Linux (5.0.7-arch1-1-ARCH), opensnitch version: 20181221.365_0316580-1 Did not note down the exact amount of memory usage (sorry), but I think it was about 9GB in a 32GB system.

robeastham commented 5 years ago

Can confirm - using 6GB after 24hrs on 16GB RAM Gnome based 18.04.2 install.

britzke commented 5 years ago

Dös anybody has n idea, where to look for it? May be I do not have to debug the whole code.

burghard.britzke https://britzke.berlin/

j-degreef commented 5 years ago

This may be of interest : https://medium.freecodecamp.org/how-i-investigated-memory-leaks-in-go-using-pprof-on-a-large-codebase-4bec4325e192. https://stackimpact.com/blog/memory-leak-detection-in-production-go-applications/

But personally I'm a bit tired of Google and it's "inventions" :-)

gustavo-iniguez-goya commented 5 years ago

Hi all,

Could you specifiy if the high CPU usage is caused by the UI? I can help with that I think . Could you post how many rows do you have in each tab when that problem occur?

Regarding the high mem usage, I also experienced it a while back, but for now it's contained. I'm using latest sources from the repo.

benjaoming commented 4 years ago

I want to confirm that this is an issue related to the daemon / the Go code.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                            
23228 root      20   0 4389272 2.644g   2908 S  49,7 34,4 465:43.70 opensnitchd   

As you can see, there's a memory usage of 2.5 GB... CPU time is constantly around 30-50% of a core.

gustavo-iniguez-goya commented 4 years ago

Try this branch @benjaoming , and see if you can reproduce it or if it works as expected: https://github.com/gustavo-iniguez-goya/opensnitch/tree/main

gustavo-iniguez-goya commented 3 years ago

This should be fixed with latest version.

If it still reproduces, please, open a new issue and post: