trezor / trezord-go

:smiling_imp: Trezor Communication Daemon (written in Go)
GNU Lesser General Public License v3.0
244 stars 146 forks source link

Increasing memory usage? #223

Closed slowbackspace closed 2 years ago

slowbackspace commented 3 years ago

Bridge Version: 2.0.27 (downloaded and installed separately, running as /Applications/Utilities/TREZOR Bridge/trezord -l /Users/maros/Library/Logs/trezord.log ) OS: MacOS 11.2.2

I am not sure if it is legit, but activity monitor in macOS shows increasing memory usage of trezord process. It is not a first time I noticed it, but I can't give you ani specific steps to reproduce as I don't even know for how long is trezord running on my system.

Reported memory usage by activity monitor went from 180MB to 320MB in 20 hours.

Screenshot 2021-03-04 at 10 08 25

log.gz trezord.log

tsusanka commented 3 years ago

I think @bosomt reported something similar? :thinking:

prusnak commented 3 years ago

Please test only soon-to-be released 2.0.31. This issue might have been fixed there.

tsusanka commented 3 years ago

I think @bosomt reported it on 2.0.31, let's wait for his comment.

prusnak commented 3 years ago

Btw, this increase is most probably caused by logging. When you go to http://127.0.0.1:21325/status/ there is a log available and you can also download it as a text file. And this log is stored in the memory too.

nevermind, see below

bosomt commented 3 years ago

@prusnak is it possible to start trezord with logging disabled ?

prusnak commented 3 years ago

I just noticed the file log rotates after 20 MB and memory log rotates after 90000 lines (where each line can be max 500 characters) totalling at ~ 45 MB.

So logging should not consume that much memory.

(That's also the reason why there is no switch to disable the logging).

iMilnb commented 2 years ago

Is this issue even looked at? 1.5G memory usage after 1 week. 2.0.27 is still the official version that's available to download.

prusnak commented 2 years ago

Is this issue even looked at? 1.5G memory usage after 1 week. 2.0.27 is still the official version that's available to download.

We don't provide standalone installers of Bridge anymore. Please uninstall the standalone Bridge and use Trezor Suite which bundles the latest build of Bridge.

k3a commented 2 years ago

trezord-go 2.0.31 on Arch Linux:

trezord      890  0.0  1.8 2704524 1196060 ?     Ssl  dub12  10:09 /usr/bin/trezord

VSZ 2704524 RSS 1196060 that's 1.1 GiB!

Quite a lot for such a tiny Go program. You should consider adding pprof to help finding those leaks...