amule-project/amule

Memory leak in aMule 2.3.3 Debian Bullseye

ngosang opened this issue ยท 4 comments

I have been using aMule 2.3.3 (Debian Bullseye package) for several months and I notice there is an important memory leak. I know this issue does not contain enough information to fix the problem but maybe it keeps all related issues in the same place.

I'm running aMule 24/7 in my server and I notice the RAM memory increases over the time without a reason. aMule is connected to 1 ed2k server and Kad network, just sharing files, not downloading anything. I only use amuled and amuleweb processes. As you can see in the screenshots below the issue is in amuled process.

To fix this issue I configured a cron task that restarts aMule every 2 days, if I don't, the memory keeps growing lineal.
image

Just after start
image

After 2 days
image

The memory leak is not huge, just 28 MB increase of RAM per day (24 hours), but it is meaningful if you are running in a Raspberry Pi with low RAM. It can crash your system eventually. I hope you can run some memory profiler in aMule to find and fix this issue.

+1 to this. Logfile says

Assertion failed: ../../src/kademlia/kademlia/Entry.cpp:ReCalculateTrustValue:463: Assertion '!m_publishingIPs->empty()' failed. 
Backtrace follows:
[3] wxOnAssert(char const*, int, char const*, char const*, char const*) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d182d5]
[4] ?? in /usr/bin/amuled[0x564c973eb4ce]
[5] ?? in /usr/bin/amuled[0x564c973eb5c8]
[6] ?? in /usr/bin/amuled[0x564c973f14da]
[7] ?? in /usr/bin/amuled[0x564c973178c6]
[8] ?? in /usr/bin/amuled[0x564c97309378]
[9] ?? in /usr/bin/amuled[0x564c97289453]
[10] ?? in /usr/bin/amuled[0x564c972c9223]
[11] ?? in /usr/bin/amuled[0x564c97288619]
[12] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e94241]
[13] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e94333]
[14] wxEvtHandler::TryHereOnly(wxEvent&) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e9467c]
[15] wxEvtHandler::ProcessEventLocally(wxEvent&) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e94703]
[16] wxEvtHandler::ProcessEvent(wxEvent&) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e947a1]
[17] wxEvtHandler::ProcessPendingEvents() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6e9514e]
[18] wxAppConsoleBase::ProcessPendingEvents() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d1af7f]
[19] wxEventLoopManual::ProcessEvents() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d53b5c]
[20] wxEventLoopManual::DoRun() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d53c2e]
[21] wxEventLoopBase::Run() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d5397d]
[22] wxAppConsoleBase::MainLoop() in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6d1c9a6]
[23] wxEntry(int&, wchar_t**) in /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0[0x7f5db6da4a19]
[24] ?? in /usr/bin/amuled[0x564c97243fe2]
[25] __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6[0x7f5db679cd0a]
[26] ?? in /usr/bin/amuled[0x564c9724b81a]

Maybe related? Seems a release failed here.

@ngosang maybe not a problem of the amule, see this: raspberrypi/linux#5395

@ogarcia It's not related.
I'm maintaining an Alpine Linux Docker image => https://github.com/ngosang/docker-amule
And I can reproduce the issue in x64 and arm64 servers. Furthermore, I don't have issues with the OOM killer.

Another temporary solution: disable obfuscation supported

[Obfuscation]
IsClientCryptLayerSupported=0
IsCryptLayerRequested=0
IsClientCryptLayerRequired=0