Re: ffi.new intermittent failures

  • From: Lesley De Cruz <lesley.decruz@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 14 Nov 2013 11:30:30 +0100

On 14 November 2013 11:23, Alexander Gladysh <agladysh@xxxxxxxxx> wrote:
> On Thu, Nov 14, 2013 at 12:29 PM, Alexander Gladysh <agladysh@xxxxxxxxx> 
> wrote:
>> We observe intermittent failures in ff.new, when attempting to
>> allocate a largeish chunk of memory on Linux (see below). C calls like
>> calloc work fine.
>
> In fact, the failures are _not_ intermittent. I guess, first
> allocation is freed by GC when second fails:
[...]

ffi.new is also subject to the current 2GB limit (as the objects
created by it are also GC'ed, I suppose?).
See: 
//www.freelists.org/post/luajit/Any-plans-to-increase-the-GC-upper-limit-of-LuaJIT-on-Linux-x86-64,3
"If you allocate these with malloc() and not ffi.new(), they get
access to the full x64 address range."

Also, to avoid confusion, the "LuaJIT 2.1" referred to in that post is
now LuaJIT 3.0.

-- 
Best regards,
Lesley

Other related posts: