[Solved] Critical RAM consumption, probably bug

Post Reply
User avatar
bosapara
Member
Posts: 621
Joined: Fri Apr 07, 2017 08:49

[Solved] Critical RAM consumption, probably bug

by bosapara » Post

When we add audio tracks to the default minetest game it spend an incredible amount of RAM.

RAM consumption of the default minetest game without mods: ~150mb.

1. Lets add "audio" mod (empty code). 30 audio files (size 65mb): RAM consumption: 2000mb.
2. If we add everyone's favorite mod "mpd": 10 tracks (size 13mb): RAM consumption 650mb.

I suppose it's not a normal RAM consuption for a simple mods like background music.

Tested with 3 last client versions: 5.5.0, 5.6.0, 5.7.0

Also we got huge lag as players when audio been loaded with delay after join a server (used minetest.dynamic_add_media)
An example is below (GIF).
Image
Last edited by bosapara on Sun Nov 20, 2022 18:36, edited 1 time in total.

User avatar
DS-minetest
Member
Posts: 1275
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Critical RAM consumption, probably bug

by DS-minetest » Post

RAM consumption is probably so high because the openal implementation stores the sound data in pcm format, the ogg vorbis files are lossily compressed.
This could be fixed by unloading sounds that haven't played for long time.

Currently the minetest client loads all sounds completely as soon as it gets the sounds. So, startup time is very slow, especially with many sounds or long sounds (i.e. music). And if you receive dynamic media or play a sound from the sound-pack, the client can freeze for seconds.
I've already made a PR to fix these issues. Feel free to try it out: https://github.com/minetest/minetest/pull/12764
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
bosapara
Member
Posts: 621
Joined: Fri Apr 07, 2017 08:49

Re: Critical RAM consumption, probably bug

by bosapara » Post

DS-minetest,

Thank you for explaining and PR, great work.

User avatar
Komodo
Member
Posts: 132
Joined: Tue Jan 11, 2022 13:33
In-game: Komodo
Location: United States of America
Contact:

Re: [Solved] Critical RAM consumption, probably bug

by Komodo » Post

Yep, this has been a difficult thing to work with in MeseCraft, which adds many environment, mob, music, and other sounds.
🌎 Website | 🌲 MeseCraft Game | 📰 News | 🖌️ ContentDB

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests