Working around the 2GB limit

  • From: Petri Häkkinen <petrih3@xxxxxxxxx>
  • To: luajit <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 31 Jan 2013 15:02:39 +0200

Hi,

I've recently hit the 2GB limit with Legend of Grimrock running on OS X. 

Basically the problem occurs because the game has lots of textures, other 
OpenGL resources, audio etc. which get placed into the "LuaJIT friendly" 
address space. Afaik, there is no way to control where OpenGL and OpenAL places 
the resources in memory.

I think I can deal with the problem in this case by optimizing mem usage on a 
general level and moving what I can beyond 2GB, but I'm worried that in the 
long run, with the next game project that is much bigger than Grimrock, the 
situation will be worse with a lot more assets stamping on the LuaJIT universe.

So until LuaJIT 2.1 increases the limit to 4GB, what are the best practices to 
workaround the issue?

Is it possible that in the future (perhaps LuaJIT 3?) the address space 
limitation will be lifted off (perhaps optionally)? I understand this does not 
affect pure Lua applications that much but with projects allocating lots of 
resources from various sources, it can become a nightmare to track where memory 
allocations go in the address space.

Best Regards,

Petri Häkkinen


Other related posts: