self-host icon indicating copy to clipboard operation
self-host copied to clipboard

Memory leak

Open Aviator7595 opened this issue 1 year ago • 2 comments

I am setting up a BW server and before using it I noticed that it is consuming more and more memory after each day depsite the fact that the db was empty (no passwords or whatever) and the server was not used by anyone, not even to connect to the portal. I decided to run a test for over 24h and below are the results. With htop, I noticed that Dotnet DLLs were loaded 19 times each! (which does not seem normal). these dlls are: Api.dll, Identity.dll, admin.dll, notification.dll, Icons.dll). Between the beginning of the test and the end, their memory consumption increased by more than 2% of total memory consumption (plus 2% for each dotnet dll which are a total of 19 * 5= 95) My config: Unified Beta Server Installed 2024.3.0 DB: sqlite Certificate generated wiht let's encrypt (so no proxy used) SMTP configured

Total of memory consumed according to docker stats: at 13:34 -> 329M (just started the server) at 13:35 -> 402M at 13:38 -> 414.8M at 13:53 -> 422.3M at 13:53 -> 444.2 (I loaded the login page on chrome without loging in and close the web page right away) at 14:08 -> 521.5M at 14:24 -> 531.4M at 14:39 -> 533.5M at 14:55 -> 534.7M at 15:27 -> 541.6M at 22:41 -> 712.5M at 10:15 -> 753M at 17:47 -> 788M

Again, the server is not doing anything (just loaded the login page once and that's it) Here is my htop filtered on dotnet at 13:35 (shortly after starting the server) image

Aviator7595 avatar Mar 25 '24 17:03 Aviator7595

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

Greenderella avatar Mar 29 '24 12:03 Greenderella

Hi @Greenderella

Thanks for your message and for trying to reproduce. Maybe a couple of additional info which may help:

  • I'm using a Raspberry pi 5
  • Regarding the results above, they have been obtained without limiting Bitwarden container's memory usage (have not used the -m or --memory in docker run). I'm aware that Bitwarden container will consume memory that is available to it but using more and more ram overtime without doing anything should not be expected.
  • Moreover, I tested with limiting container's memory to 800M and after 24h, htop shows that Swap space is fully used. I monitored swap space and it was fully used by by dotnet DLLs (the ones I have previously mentionned).
  • I insist on the fact that the DB is empty and I'm not trying to use the server (other than loading the login page at some point)

Btw, do you also have Dotnet Dlls loaded 19 times each? Is-it normal?

Thank you!

Aviator7595 avatar Mar 29 '24 13:03 Aviator7595