Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/chromium/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,4 @@ os-17474-ozone_add_nexus_backend_for_ozone.patch
add_mse_support_to_brightsign_video_player_os-19598.patch
gpu_enable_validating_command_decoder_for_brightsign_builds.patch
feat_brightsign_add_mouse_wheel_scroll_to_evdev.patch
gin_cap_v8_coderange_to_64mb_on_low-memory_systems.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Caner Altinbasak <cal@brightsign.biz>
Date: Thu, 4 Jun 2026 15:54:18 +0100
Subject: gin: cap V8 CodeRange to 64MB on low-memory systems

On embedded systems with <=512MB of physical RAM visible to the kernel
(e.g. BrightSign Pagani where 484MB is reserved for Broadcom BMEM),
the default V8 CodeRange of 256MB exceeds the kernel's overcommit
heuristic (CommitLimit). Both the browser and renderer processes need
their own CodeRange, so 2x256MB is impossible on a system with only
~235MB CommitLimit.

When ConfigureDefaults leaves code_range_size at 0 (because
RLIMIT_DATA is unlimited), V8 falls back to kMaximalCodeRangeSize
(256MB on ARM64). This causes the renderer's mmap to either fail with
OOM.

Fix by explicitly setting code_range_size to 64MB (kMinimumCodeRangeSize)
when physical memory is <=512MB and ConfigureDefaults did not already
set a code_range_size. This allows both processes to reserve their
CodeRange within the kernel's overcommit budget (2x64MB = 128MB).

diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index 24127c579e149345cc9b937b17dbfe630b0d3c35..406fc211731fd28e3047675e09c26e265e97cbb3 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -198,6 +198,16 @@ IsolateHolder::getDefaultIsolateParams() {
params->constraints.ConfigureDefaults(
base::SysInfo::AmountOfPhysicalMemory().InBytesUnsigned(),
base::SysInfo::AmountOfVirtualMemory().InBytes());
+ // On memory-constrained systems (<=512MB usable RAM), the default CodeRange
+ // of 256MB is too large to be allocated in both the browser and renderer
+ // processes. Cap it to 64MB (V8's minimum) so that both processes can
+ // successfully mmap their CodeRange without exceeding the kernel's
+ // overcommit heuristic (CommitLimit).
+ if (base::SysInfo::AmountOfPhysicalMemory().InBytesUnsigned() <=
+ 512u * 1024u * 1024u &&
+ params->constraints.code_range_size_in_bytes() == 0) {
+ params->constraints.set_code_range_size_in_bytes(64u * 1024u * 1024u);
+ }
params->array_buffer_allocator = g_array_buffer_allocator;
params->allow_atomics_wait = true;
params->external_references = g_reference_table;
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Add non-daylight-saving EST and MST zones so that we can check against
them in the unit test.

diff --git a/source/common/putil.cpp b/source/common/putil.cpp
index 42e8be1170af1de2151a2434b5459923825bb6eb..0e1b29d390415b1aee8d1acff5e0c66b2e3b6db5 100644
index ea15fdff0b0c67d09daf5a403f038be572cd1fbf..bb7c66832b2ffe46588572de143a5c549c5356b1 100644
--- a/source/common/putil.cpp
+++ b/source/common/putil.cpp
@@ -806,16 +806,16 @@ static const struct OffsetZoneMapping OFFSET_ZONE_MAPPINGS[] = {
@@ -801,16 +801,16 @@ static const struct OffsetZoneMapping OFFSET_ZONE_MAPPINGS[] = {
{-43200, 1, "ANAT", "ANAST", "Asia/Anadyr"},
{-39600, 1, "MAGT", "MAGST", "Asia/Magadan"},
{-37800, 2, "LHST", "LHST", "Australia/Lord_Howe"},
Expand All @@ -35,7 +35,7 @@ index 42e8be1170af1de2151a2434b5459923825bb6eb..0e1b29d390415b1aee8d1acff5e0c66b
{-25200, 1, "HOVT", "HOVST", "Asia/Hovd"},
{-25200, 1, "KRAT", "KRAST", "Asia/Krasnoyarsk"},
{-21600, 1, "NOVT", "NOVST", "Asia/Novosibirsk"},
@@ -850,15 +850,17 @@ static const struct OffsetZoneMapping OFFSET_ZONE_MAPPINGS[] = {
@@ -845,15 +845,17 @@ static const struct OffsetZoneMapping OFFSET_ZONE_MAPPINGS[] = {
{14400, 2, "PYT", "PYST", "America/Asuncion"},
{18000, 1, "CST", "CDT", "America/Havana"},
{18000, 1, "EST", "EDT", "US/Eastern"}, /* Conflicts with America/Grand_Turk */
Expand Down
Loading