Massive memory leak in MT 5.0.0?

User avatar
Posts: 3535
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Massive memory leak in MT 5.0.0?

by Wuzzy » Tue Mar 12, 2019 07:40

(I wrote this in the News thread, but I repeat it here so it's more visible:)

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.
If I keep running Minetest for a while and explore the world, it eventually eats up all my ~8 gigs of memory at an alarming rate.
This never happened to me in previous versions.

When I quit the world, only some memory seems to be freed. Sooner or later my memory is full and I have to close Minetest. That problem killed my system multiple times in the last days.

The same seems to happen with MTG, the memory consumption also grows and grows, although not that fast.

Did anyone else notice extreme memory consumption? Might this be a regression?
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Posts: 2105
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: Massive memory leak in MT 5.0.0?

by Linuxdirk » Tue Mar 12, 2019 09:41

Wuzzy wrote:Did anyone else notice extreme memory consumption? Might this be a regression?

Not personally, but currently I'm on this issue with one of my mods:

During testing added print(collectgarbage("count")) to a globalstep construct that runs every second and the value rised for some seconds and then is reduced and rises again and is reduced again but to a higher value it was reduced before. This continuesd during testing but may trigger an OOM exception like H4mlet explires with Windows 7.

Edit: Found the issue and it is unrelated to potential memory leaks and maybe was actual memory usage gone crazy on Windows. So no, I did not notice any extreme memory consumption..
Last edited by Linuxdirk on Tue Mar 12, 2019 17:37, edited 1 time in total.

User avatar
Posts: 409
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Posts: 2059
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Massive memory leak in MT 5.0.0?

by sofar » Tue Mar 12, 2019 21:59

Quit message received.
AL lib: (WW) ReleaseALBuffers: (0x6b08ac0) Deleted 135 Buffers
==15368== HEAP SUMMARY:
==15368== in use at exit: 316,355 bytes in 3,350 blocks
==15368== total heap usage: 1,267,313 allocs, 1,263,963 frees, 3,223,400,122 bytes allocated
==15368== LEAK SUMMARY:
==15368== definitely lost: 2,456 bytes in 20 blocks
==15368== indirectly lost: 6,068 bytes in 138 blocks
==15368== possibly lost: 0 bytes in 0 blocks
==15368== still reachable: 307,831 bytes in 3,192 blocks
==15368== suppressed: 0 bytes in 0 blocks
==15368== Rerun with --leak-check=full to see details of leaked memory
==15368== For counts of detected and suppressed errors, rerun with: -v
==15368== Use --track-origins=yes to see where uninitialised values come from
==15368== ERROR SUMMARY: 69036 errors from 56 contexts (suppressed: 0 from 0)

This is the output from a valgrind run where I actually connected to a server, using the UI, then disconnected.

It appears that any memory leaks are reasonably small. I didn't play for a long time, but 2k bytes lost is tiny compared to the amount of memory allocated and not a major concern. More data would be better, of course, but running under valgrind is expensive and (unplayably) slow.

Return to Problems

Who is online

Users browsing this forum: No registered users and 3 guests