react-native-community / jsc-android-buildscripts

Script for building JavaScriptCore for Android (for React Native but not only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsc default create 128M MemoryPoolSize on arm64, that's to big

jinshiyi11 opened this issue · comments

Issue Description

jsc default create 128M MemoryPoolSize on arm64,in JavaScriptCore\jit\ExecutableAllocator.cpp,this to big and may cause oom on old android device

#if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
#elif CPU(ARM)
static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
#elif CPU(ARM64)
static const size_t fixedExecutableMemoryPoolSize = 128 * 1024 * 1024;
#elif CPU(X86_64)
static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
#else
static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
#endif

Version, config, any additional info

version v250230.2.1

can i use

JSC::Options::jitMemoryReservationSize()

to change the default jit memory?

I found that we can set environment variables to set default values of JSC::Options

Os.setenv("JSC_jitMemoryReservationSize", "16777216", true);