Minetest with LuaJit GC64 mode (>2gb mem)

User avatar
Fixer
Member
 
Posts: 891
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Minetest with LuaJit GC64 mode (>2gb mem)

by Fixer » Tue Aug 08, 2017 15:07

LuaJIT 2.1.0-beta3 was recently released, changelog states:
"Apart from various fixes, the major new features are JIT compiler support for x64 in GC64 mode, ARM64 and MIPS64."

In GC64 mode LuaJit can address more than 2Gb of memory, that in theory will prevent most of OOM errors you see in minetest with heavy modpacks, worldedit or other cases. Some people like me were heavily impacted by 2gb memory limit with impossibility to play heavy modpacks (at least on windows).

People are welcome to test the build (by sfan5).

My results so far:
+ Worldedit works on large volumes now, I had no problems editing areas as much as 800x800x100 (65 million nodes) with minetest mem usage up to 4.5 Gb, that was clearly not possible before.
+ Dreambuilder modpack straight fly test for over 1 hr 40 min without any OOMs (without gc64 it is just 5-10 min before OOM).
+ Testing lua code for consuming lots of memory seems to work without crash now:
Code: Select all
a = {}; for i = 1,1500000 do a[i] = table.copy(minetest.registered_nodes); end

Original issue about Lua OOM problems: https://github.com/minetest/minetest/issues/2988
People with lua out of memory errors are welcome to test this, this may be a cure.
 

elettrico
Member
 
Posts: 22
Joined: Thu Jul 20, 2017 20:00

Re: Minetest with LuaJit GC64 mode (>2gb mem)

by elettrico » Mon Sep 04, 2017 16:01

In my linux mint machine how can I install the latest LuaJIT? Is there an official PPA? Or better remove the package and compile it from sources? Which version of lua is supported?
 

elettrico
Member
 
Posts: 22
Joined: Thu Jul 20, 2017 20:00

Re: Minetest with LuaJit GC64 mode (>2gb mem)

by elettrico » Wed Sep 06, 2017 02:15

Today I've built LuaJIT 2.1.0-beta3 and built minetestserver using it.
When I've tried to do a //sphere 250 air with worldedit (in a emerged area) it crashed with OOM.
When I've tried to do the same but with a 200 blocks radius it crashed with this error:

2017-09-05 23:04:08: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'worldedit_commands' in callback on_chat_message(): std::bad_alloc
2017-09-05 23:04:08: ERROR[Main]: stack traceback:
2017-09-05 23:04:08: ERROR[Main]: [C]: in function 'write_to_map'
2017-09-05 23:04:08: ERROR[Main]: ...r/.minetest/mods/Minetest-WorldEdit/worldedit/common.lua:111: in function 'finish'
2017-09-05 23:04:08: ERROR[Main]: ...inetest/mods/Minetest-WorldEdit/worldedit/primitives.lua:41: in function 'sphere'
2017-09-05 23:04:08: ERROR[Main]: ...test/mods/Minetest-WorldEdit/worldedit_commands/init.lua:492: in function 'callback'
2017-09-05 23:04:08: ERROR[Main]: ...test/mods/Minetest-WorldEdit/worldedit_commands/safe.lua:48: in function 'func'
2017-09-05 23:04:08: ERROR[Main]: ...est-install/share/minetest/builtin/game/chatcommands.lua:30: in function <...est-install/share/minetest/builtin/game/chatcommands.lua:9>
2017-09-05 23:04:08: ERROR[Main]: ...inetest-install/share/minetest/builtin/game/register.lua:412: in function <...inetest-install/share/minetest/builtin/game/register.lua:392>

leaving map barely untouched (instead of a large sphere there's a 64x64x64 hole)
 

User avatar
sfan5
Moderator
 
Posts: 3817
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

Re: Minetest with LuaJit GC64 mode (>2gb mem)

by sfan5 » Wed Sep 06, 2017 11:56

Just building 2.1.0-beta3 is not enough, you also need to uncomment this in the Makefile.
So far I've had no luck getting that mode to run without segfaults under stress testing (on Linux).
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 


Return to General Discussion



Who is online

Users browsing this forum: MSN [Bot] and 3 guests