jsc-android-buildscripts icon indicating copy to clipboard operation
jsc-android-buildscripts copied to clipboard

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

Open jinshiyi11 opened this issue 3 years ago • 2 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

jinshiyi11 avatar Jul 31 '21 13:07 jinshiyi11

can i use

JSC::Options::jitMemoryReservationSize()

to change the default jit memory?

jinshiyi11 avatar Aug 01 '21 14:08 jinshiyi11

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

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

jinshiyi11 avatar Aug 02 '21 12:08 jinshiyi11