Hacker News new | past | comments | ask | show | jobs | submit login

V8 allocates a “gigacage” around every wasm memory area on modern 64 bit processors and marks them so the OS will trap on an unexpected access. This is much more efficient than doing a bounds check on every access. These pages are not actually resident.

“Big number is scary” is not a good way to understand performance.




No, but it means there is one less thing we can rely on to identify "process gone whacky".

Plus, admittedly I didn't think about this thoroughly just now, this sounds like a cheap hack for speed. You could still have an OOB access that would land in some valid memory and thus lead to an exploit, right? It's just made very unlikely by making these areas very large and having ASLR. Proper bounds checks wouldn't have that problem.


The memory is still owned by the electron process, so ASLR is not involved here. Also in case of OOB, you still land into the electron process.

VIRT is not a good measure of actual memory usage because it includes shared pages like file cache and libraries, RES is better.

Shameless plug: I developed a tool that try to compute a better value for memory usage: https://github.com/tatref/linux-mem




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: