orwell96 / advtrains

Minetest Mod: Advanced Trains
https://forum.minetest.net/viewtopic.php?f=11&t=14726
GNU Lesser General Public License v2.1
43 stars 13 forks source link

Lua out of memory error #11

Closed gbl08ma closed 7 years ago

gbl08ma commented 7 years ago

So I just updated to ~the latest~ a very recent version of this mod (commit ee24a50b25db8d34ef0b11e1f0eba30affb39cd3), and after moving around for a bit in my world (which worked fine on a previous version of this mod, on the same Minetest install), Lua goes out of memory:

OOM error from mod 'advtrains' in callback environment_Step(): not enough memory Current Lua memory usage: 45 MB

This world contains a relatively big train network with probably over 2000 blocks of track, all reachable from each other. There are not many trains, however (at most, 10 subway trains). The first two times I loaded the world, it crashed within seconds. The third and latest time, I was able to ride a train for about a minute or so, then the server crashed with the above message. The error messages for the two previous times were the same, only the memory usage value changed a bit.

I can share a world map or even the whole world (needs lots of mods though) with the devs, if that would help.

I have a much smaller world with, like, 200 blocks of track, and this problem doesn't occur.

orwell96 commented 7 years ago

WTF. Can you tell the file size of advtrains_trackdb inside your world directory?

gbl08ma commented 7 years ago

advtrains_trackdb is 720440 bytes in size.

gbl08ma commented 7 years ago

I believe I may have tracked the problem down a bit. I am playing on a 2160x1440 screen (Surface Pro 3). As long as I keep the Minetest window at the default size (which is what, 800x600?), the game doesn't crash. As soon as I maximize the window (or a few seconds after I do it), the game hangs and then crashes with the aforementioned OOM error.

Using the advtrains version I was previously using (from August 30), I could play with the window maximized, without problem. The fact that the problem only occurs at higher resolutions makes me think it is related to textures...

EDIT: so I tried loading the world again, maximized the window, and managed to play for two or three minutes. However, once I tried to change a switch (by right-clicking it), the game froze and then crashed with a OOM error...

orwell96 commented 7 years ago

the trackdb is <1mb in size, so where do the remaining 44mb come from? Maybe textures?

gbl08ma commented 7 years ago

I don't know... but after loading the world for a fifth time it no longer crashes. It has more lag than in the previous version, but that is to be expected with the increase in the amount of features. Hopefully on my more powerful laptop it will work better. For some reason, the update made it crash on the first few tries, or at least until it loaded more of the world. Now the problem no longer occurs. I blame some sort of cache... By the way, the detector rails and switches seem to work fine.

orwell96 commented 7 years ago

I never said this mod is lightweight!