ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.18k stars 157 forks source link

bridge uses enormous amounts of RAM #335

Closed yogo1212 closed 1 year ago

yogo1212 commented 1 year ago

Expected Behavior

Bridge syncs mailbox

Current Behavior

The bridge processes' memory usage varies from 1.1g to 2.3g when syncing bigger mailboxes (added swap to learn the upper limit). Frankly, that is a bit excessive. oomkiller then comes round and kills the bridge.

FATA[Jan 27 09:08:13.220] Failed to launch                              error="signal: killed" exe_path=/usr/lib/protonmail/bridge/bridge exe_to_launch=bridge launcher_path=/usr/lib/protonmail/bridge/proton-bridge launcher_version=3.0.10

Out of memory: Killed process 3739716 (bridge) total-vm:4768120kB, anon-rss:1744272kB, file-rss:0kB, shmem-rss:0kB

Possible Solution

Steps to Reproduce

  1. log into a big mailbox
  2. wait

Version Information

Package 3.0.10-1

Context (Environment)

The protonmail-bridge runs next to a small mailserver and is supposed to help integrate protonmail into the existing mail infrastructure.

Detailed Description

I guess someone will have to look at the memory usage.

gabor-meszaros commented 1 year ago

Hi @yogo1212, Thank you for reporting this issue, and I am sorry for the inconvenience. In the first phase of Bridge v3 development, we mainly focused on its speed (e.g., sync, serving requests, etc), and some of these optimizations had an effect on its memory consumption. We have already implemented some improvements on it (GODT-2224, currently unreleased), but will further monitor Bridge performance and make adjustments on it if necessary. For now, the improvement will be released soon, and the changes will be open source even sooner. I hope it will help.

yogo1212 commented 1 year ago

thanks for the update!

LBeernaertProton commented 1 year ago

@yogo1212 The 3.1.x release has the improvements related to memory usage.

yogo1212 commented 1 year ago

@LBeernaertProton thanks for letting me know! sadly, i don't have a large mailbox to test atm because my workaround was to aggressively archive old emails and i had no problems since.