Massive memory leak in MT 5.0.0?

Massive memory leak in MT 5.0.0?

Postby Wuzzy » Tue Mar 12, 2019 7:40 am

(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?
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby Linuxdirk » Tue Mar 12, 2019 9:41 am

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: https://gitlab.com/4w/mtimer/issues/7

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..
Linuxdirk
Member
 
Posts: 1875
Joined: Wed Sep 17, 2014 11:21 am
In-game: Linuxdirk

Re: Massive memory leak in MT 5.0.0?

Postby jas » Tue Mar 12, 2019 12:58 pm

nope
jas
Member
 
Posts: 346
Joined: Mon Jul 24, 2017 6:15 pm
GitHub: jastevenson303
In-game: jas

Re: Massive memory leak in MT 5.0.0?

Postby sofar » Tue Mar 12, 2019 9:59 pm

Quit message received.
AL lib: (WW) ReleaseALBuffers: (0x6b08ac0) Deleted 135 Buffers
==15368==
==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==
==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==
==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.
sofar
Developer
 
Posts: 2000
Joined: Fri Jan 16, 2015 7:31 am
GitHub: sofar
In-game: sofar

Re: Massive memory leak in MT 5.0.0?

Postby Wuzzy » Wed Mar 13, 2019 6:16 am

I believe I found the root of all evil!

The profiler. I totally forgot I had turned it on because I was testing mapgen. So it just kept running and running and running. Surely this allocated tons of data. Turning the profiler lowers the memory consumption greatly! :D
Still a bit strange that Minetest doesn't free the memory after I left the game.

And yeah, the memory leak you found is tiny, it can't explain why my memory was eaten away so fast (it was a matter of, like 15-20min to have my 8 gigs eaten away).
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby Wuzzy » Thu Mar 14, 2019 11:41 am

Oh, man. Turns out it was not that simple. :-(
After a longer session I saw my memory getting eaten up fast again. But my profiler was off the whole time. WTF?

Maybe I should see and check if this happens with default settings as well. But something smells fishy …
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby ShadMOrdre » Thu Mar 14, 2019 4:27 pm

Wuzzy,

Maybe a mod, that now acts differently under 5.0?
ShadMOrdre
Member
 
Posts: 252
Joined: Mon Dec 29, 2014 8:07 am
GitHub: ShadMOrdre
In-game: shadmordre

Re: Massive memory leak in MT 5.0.0?

Postby sofar » Fri Mar 15, 2019 5:31 am

It's entirely possible that my short session wasn't really representative, and it can't really be because valgrind is really really costly to use. Knowing if Wuzzy used e.g. MCL2 or MTG or some other game would help a lot.
sofar
Developer
 
Posts: 2000
Joined: Fri Jan 16, 2015 7:31 am
GitHub: sofar
In-game: sofar

Re: Massive memory leak in MT 5.0.0?

Postby Wuzzy » Fri Mar 15, 2019 6:27 am

Sofar fails at reading comprehension.
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby Festus1965 » Sat Mar 16, 2019 1:16 am

guys,
I have less time but yesterday happened something remind me this thread.
I have an own web server here beside the mts running, what I use also to test clients and jail minetest clones, whatever ...

Fact:
I still have running there the mtc 5.0.0-bba4563 and didn't update them as they run since I use them,
but yesterday I changed 5 of them to "enable : saving map received from server" and logged them in first time ever server freeze and no any ram out of 16 GB was free anymore.

So for sure that was the only change I did in last 2 weeks for sure made this big difference.

It this is fixing to that thread, take it, if not tell me. As then also I might be able to change all of them to 5.0.0-stable and do the same again, disable and enable and let run again. But first I wait for your response keep this config, but no saving and testing ... just now running
Festus1965
Member
 
Posts: 804
Joined: Sun Jan 03, 2016 11:58 am
In-game: Thomas Explorer

Re: Massive memory leak in MT 5.0.0?

Postby Wuzzy » Sat Mar 16, 2019 3:03 am

No, this setting was off for me.
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby sofar » Sat Mar 16, 2019 4:04 am

Wuzzy wrote:Sofar fails at reading comprehension.


I don't tend to re-read the entire conversation again, sorry.
sofar
Developer
 
Posts: 2000
Joined: Fri Jan 16, 2015 7:31 am
GitHub: sofar
In-game: sofar

For those who didn't even read the first post …

Postby Wuzzy » Sat Mar 16, 2019 6:09 am

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: For those who didn't even read the first post …

Postby sofar » Mon Mar 18, 2019 7:41 pm

Wuzzy wrote:
I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.

I believe I noticed a massive memory leak in Minetest 5.0.0 while developing MineClone 2.


I should just report this.

I clicked on "new posts" as usual, and nothing on my page that my browser showed me included the information. Because the thread was several replies long, I didn't scroll back up. I have other things to do, and re-reading long threads is something I just don't do.

But hey, copy and paste it a few more time if that makes you happy. Go run valgrind yourself while you're at it.
sofar
Developer
 
Posts: 2000
Joined: Fri Jan 16, 2015 7:31 am
GitHub: sofar
In-game: sofar

Re: Massive memory leak in MT 5.0.0?

Postby Wuzzy » Tue Mar 19, 2019 2:02 am

:-(
Wuzzy
Member
 
Posts: 3402
Joined: Mon Sep 24, 2012 3:01 pm
GitHub: Wuzzy2
In-game: Wuzzy

Re: Massive memory leak in MT 5.0.0?

Postby DELTA_FORCE » Thu Mar 28, 2019 8:15 pm

This is a serious problem. Many mods and games are not compatible and have problems inside MT5, so you may have to check what you think may be causing a problem and fix it. (This would be extremely difficult to find the problem, but it is better than nothing I guess)
DELTA_FORCE
Member
 
Posts: 143
Joined: Tue Oct 30, 2018 1:26 am
In-game: DELTA_FORCE



Return to Problems



Who is online

Users browsing this forum: Google Bot [Bot] and 0 guests