greenbone / gsa

Greenbone Security Assistant - The web frontend for the Greenbone Community Edition
GNU Affero General Public License v3.0
212 stars 95 forks source link

memory leak in gsad #1056

Closed pomac303 closed 3 years ago

pomac303 commented 5 years ago

Expected behavior

Running as a webservice, using a minimal amount of memory

Actual behavior

It oom:s my server, just restarted it since it was using 4.9 GB of RES memory...

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2327 root 20 0 6189848 4,950g 10484 S 0,0 42,3 11:47.84 gsad

Steps to reproduce

  1. Start it
  2. let it run
  3. see it consume memory

Seriously though, do you have any clues or ideas of debugging and finding out?

GVM versions

gsa: (gsad --version) Greenbone Security Assistant 7.0.3 Copyright (C) 2010-2016 Greenbone Networks GmbH License GPLv2+: GNU GPL version 2 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

gvm: (gvmd --version)

openvas-scanner: (openvassd --version) OpenVAS Scanner 5.1.3 Most new code since 2005: (C) 2016 Greenbone Networks GmbH Nessus origin: (C) 2004 Renaud Deraison deraison@nessus.org License GPLv2: GNU GPL version 2 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

gvm-libs: 9.0.3

Environment

Operating system:

Installation method / source: (packages, source installation)

Ubuntu 18.04

Packages, specially built manager to use postgres since sqlite doesn't scale...

Logfiles

bjoernricks commented 5 years ago

Maybe the issue is already fixed with https://github.com/greenbone/gsa/pull/676

Could you test the patch and check if your memory leak still persists?

pomac303 commented 5 years ago

You'd think that downloading a patch would be easy on github but no such luck... what am I missing?

cfi-gb commented 5 years ago

@pomac303

You'd think that downloading a patch would be easy on github but no such luck... what am I missing?

Not sure if there is any documentation on this available at the github Help but from time to time a "ProTip!" is shown at the bottom of each PR which contains a note like (example of the #676 PR including the related links):

ProTip! Add .patch or .diff to the end of URLs for Git’s plaintext views.

pomac303 commented 5 years ago

Ok, usually there is a "raw" or so link...

Anyway, I applied it manual and while there still seems to be a memory leak it's much better

pomac303 commented 5 years ago
VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     

2104104 1,275g 10308 S 0,0 10,9 3:33.08 gsad

I do tend to extract the CVE reports though, so I wonder if there is something there that isn't handled properly

pomac303 commented 5 years ago

Took longer, still leaks quite a bit...

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27997 root 20 0 5871424 4,161g 9680 S 0,0 35,5 8:57.16 gsad

bjoernricks commented 3 years ago

gsad will not get much development in the future anymore. Therefore I am closing this issue.