[Webkit-unassigned] [Bug 118733] Javascript JIT still allocates 2GB of memory on x86-64 Linux

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 16 09:03:17 PDT 2013


--- Comment #3 from Török Edwin <edwin+webkit at etorok.net>  2013-07-16 09:03:25 PST ---
(In reply to comment #2)
> (In reply to comment #0)
> > Created an attachment (id=206778)
 --> (https://bugs.webkit.org/attachment.cgi?id=206778&action=review) [details] [details]
> > Use MAP_32BIT
> > 
> > See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712387 for the original bugreport.
> > 
> > Currently the javascript JIT allocates 2GB on x86-64, to ensure that all jumps are within a 2GB range.
> > This causes problems without overcommit (or without a swapfile), even on a machine with 8GB of physical RAM.
> > 
> > Attached is a patch that uses MAP_32BIT, instead of the wasteful allocation of 2GB.
> It doesn't use 2gig of memory, it reserves 2gig of address space.  I would be stunned if linux cannot handle reserving address space as that's a common technique used by garbage collectors.
> 32Mb is also vastly too small to successfully jit large pieces of JS so i'll assume that there were no perf tests run on this patch either.

Right, I have tested this only with Qt/KDE, where JIT performance doesn't really matter (in fact I'd be perfectly happy with disabling the JIT for it).

I haven't checked how the allocation code works, but won't it allocate more pools when it runs out of the 32MB?

I've chosen 32MB because that is what the 32-bit code uses, but if a larger value would be more appropriate then both should be updated.

> I think the correct fix here is to find out how linux GCs reserve address space without having the VM allocate physical backing memory.

There is a MAP_NORESERVE on the allocation but that doesn't seem to do what its supposed to: the OOM killer kicks in and starts killing applications once KWin+plasma-desktop+other applications exceed my physical RAM (8GB).
If I run the patched libqt4-script (which has the patched javascriptcore), then the memory usage of KDE is no longer >2GB, and the OOM killer never kicks in.

Reserving 2GB of VIRT, for a feature that is not critical for the application is not really nice...

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list