ElCeejo / draconis

Adds Dragons and related resources and equipment to Minetest Game
MIT License
18 stars 23 forks source link

Memory leak #44

Open BobOmbuzal opened 8 months ago

BobOmbuzal commented 8 months ago

Server crashes when draconis is enabled, when i join and there are dragons around, moving:

2024-04-01 17:25:00: ERROR[Server]: An unhandled exception occurred: C++ out of memory
2024-04-01 17:25:00: ERROR[Server]: In thread 7f04dbfff700:
2024-04-01 17:25:00: ERROR[Server]: /mnt/mt/minetest/src/server.cpp:8c: virtual void* ServerThread::run(): A fatal error occurred: C++ out of memory

Tested versions:

BobOmbuzal commented 7 months ago

Weird, i disabled draconis and it still crashes the only mods i got are creatura, animalia, draconis when i disabled animalia too mt works again. enabled animalia again, still works enabled draconis again, mt crashes disabled animalia, mt works sometimes it works for ~30min until it crashes

BobOmbuzal commented 6 months ago

Probably related https://github.com/ElCeejo/animalia/issues/94

BarbeRousseLibre commented 6 months ago

Hello,

You should probably, to confirm your problem is somehow related to mine, do the instruction in my topic to create a simple logmem mods and checks for the amount of memory usage used by LUA compared to the minetestserver process.

I use the dumb-bash script below of my doing to write into a log file the every-5-seconds amount of RAM usage by the whole minetestserver process:

#!/bin/bash 

SERVER_NAME="servername"
LOG_DIR="/PATH/TO/YOUR/LOGDIR/$SERVER_NAME"
LOG_FILE="NAME_OF_YOUR_LOGFILE_$SERVER_NAME.log"
LOG_PATH="$LOG_DIR/$LOG_FILE"
REFRESH_RATE=5

while true
do
    echo -e "--- * --- * --- * ---\n" >> $LOG_PATH
    echo -e $(date +"%d-%m-%Y %H:%M:%S") "\n"  >> $LOG_PATH
    ps -eo size,pid,user,command --sort -size |     awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |    cut -d "" -f2 | cut -d "-" -f1 | grep "minetestserver" >> $LOG_PATH
    echo -e "\n --- * --- * --- * ---\n" >> $LOG_PATH
    sleep $REFRESH_RATE 
done

It's helpful, even if it's poorly written, to compare the amount of RAM used by LUA aside the whole minetestserver process, better, if it crash logs allows you to check after the RAMocalypse.

Also, should you not post also your OS parameters (as version), etc ? I guess it could be a problem on some OS and not others… Could maybe also a problem related to a specific version of a library on Windows, Linux, *BSD… You see my point, I think :).

If needed, for some reasons you can't do that yourself, just ask. Will be glad to give help to fix this, since it disallow me to play !

Regards, GASPARD DE RENEFORT Kévin