Put the mapping into the first 2 Gigabytes of the process address space. This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2GB of memory, so as to improve context-switch performance on some early 64-bit processors.
A full GC takes 50% more time than the allocations themselves.
If the GC is enabled, it doubles the allocation time.
To simulate a real application, the links between objects are randomized in the third run. This doubles the GC time!
And that was just for 1GB! Now imagine using 8GB — a full GC cycle would keep the CPU busy for a whopping 24 seconds! Ok, so the normal mode is to use the incremental GC. But this just means the overhead is ~30% higher, it’s mixed in between the allocations and it will evict the CPU cache every time. Basically your application will be dominated by the GC overhead and you’ll begin to wonder why it’s slow ….
tl;dr version: Don’t try this at home. And the GC needs a rewrite (postponed to LuaJIT 2.1).
> How to get past 1gb memory limit of 64 bit LuaJIT on Linux? > LuaJIT x64 limited to 31 bit address space, even without MAP_32BIT restrictions? > LuaJIT strange memory limit > Digging out the craziest bug you never heard about from 2008: a linux threading regression
Put the mapping into the first 2 Gigabytes of the process address space. This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2GB of memory, so as to improve context-switch performance on some early 64-bit processors.
A full GC takes 50% more time than the allocations themselves.
If the GC is enabled, it doubles the allocation time.
To simulate a real application, the links between objects are randomized in the third run. This doubles the GC time!
And that was just for 1GB! Now imagine using 8GB — a full GC cycle would keep the CPU busy for a whopping 24 seconds! Ok, so the normal mode is to use the incremental GC. But this just means the overhead is ~30% higher, it’s mixed in between the allocations and it will evict the CPU cache every time. Basically your application will be dominated by the GC overhead and you’ll begin to wonder why it’s slow ….
tl;dr version: Don’t try this at home. And the GC needs a rewrite (postponed to LuaJIT 2.1).
> How to get past 1gb memory limit of 64 bit LuaJIT on Linux? > LuaJIT x64 limited to 31 bit address space, even without MAP_32BIT restrictions? > LuaJIT strange memory limit > Digging out the craziest bug you never heard about from 2008: a linux threading regression