Re: ffi.new intermittent failures

  • From: Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 14 Nov 2013 08:43:55 +0000

On 14 Nov 2013 08:40, "Alexander Gladysh" <agladysh@xxxxxxxxx> wrote:
>
> On Thu, Nov 14, 2013 at 12:35 PM, Justin Cormack
> <justin@xxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On 14 Nov 2013 08:30, "Alexander Gladysh" <agladysh@xxxxxxxxx> wrote:
> >>
> >> Hi, list!
> >>
> >> 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.
> >>
> >> Any clues?
> >
> > Look at the allocation code. For x64 it uses mmap with hints and needs
to
> > get low 2G addresses which can fail. Best to call mmap yourself for huge
> > allocations and allocate over 2G.
>
> Erm. What is the reason behind this implementation? That's FFI
> allocation, not one for internal Lua works.
>

Erm maybe I am getting mixed up. What does strace say is happening?

Justin

Other related posts: