-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Substantial memory leak on aarch64 and x86_64 architectures #1946
Comments
I run valgrind like this: The output: UI bufferProbably the most frequent one:
Lines 201 to 205 in beeddda
Should later get freed by Maybe we have a mistake here so the more we "write" the more the needed memory will grow because somehow we don't free. autocomplete
profanity/src/tools/autocomplete.c Lines 163 to 178 in beeddda
In line 175 we again use profanity/src/tools/autocomplete.c Line 78 in beeddda
When reading the surrounding code it looks to me like the free function will be called in appropriate places. Again its a glib container. ncurses
Which is confusing. We use the same setup/teardown for ncurses like https://gist.github.com/DesmondHayes/0c80af2654fc3ec602f9 for example. I went on to get the ncurses tarball and see if they ship examples. They have a couple of tests and I ran valgrind on libstrophe / ssl
Something for @sjaeckel ? theme
Lines 80 to 84 in beeddda
Again a glib container and we pass the relevant free functions to readline
Again I can't see where we use readline the wrong way. omemo
pgp
Allocated: Line 121 in beeddda
And freed: Lines 131 to 137 in beeddda
Again glib container muc
Lines 94 to 101 in beeddda
Again glib container with That's enough for now. Lets try to fix those and then continue. |
TL;DR: Profanity ate 1 GB swap in less than 15 days
I have profanity running on a RPi4 (aarch64 architecture) that is running ArchLinuxARM. Profanity receives notifications from e.g. cron jobs and casual interpersonal chat, altogether less than a couple of hundred messages daily — some days substantially less.
The RPi4 has 4 GB RAM + 1 GB swap. Usually no swap is used at all, so at first I didn't notice when
free -tk
reported that used and free swap had swapped places, so to speak: 100% used swap and 0% free. This was when the RPi4 andprofanity
had been up for slightly less than 15 days.A
ps ux
revealed that theprofanity
process had gobbled up 2.5+ GB RAM, including all of the available 1 GB swap. Takingprofanity
down released all of the used swap, except ~40 MB.Expected Behavior
Ideally,
profanity
should not keep gobbling up RAM.Current Behavior
Launching
profanity
again, this is what I noticed (numbers taken fromps ux
):HH:MM
is wallclock hours and minutes.I tried the same thing on a x86_64 desktop pc, running ArchLinux:
Possible Solution
I haven't got a clue.
Steps to Reproduce (for bugs)
profanity
in a terminal emulatorps ux | rg pro[f]anity
to see its increasing memory consumptionContext
N/A
Environment
profanity -v
Options used when building the package can be seen here:
Cheers.
The text was updated successfully, but these errors were encountered: