From d2ca4711144a4087ddf4f08d9de43eb1f823768e Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Tue, 16 Dec 2025 14:39:43 +0100 Subject: [PATCH] Increase SEG_ALLOC_SIZE_MAX to 64MB to support OPcache JIT on Solaris The SysV shared memory allocator in OPcache hardcodes a maximum segment size of 32MB (SEG_ALLOC_SIZE_MAX). With JIT enabled, OPcache reserves 64MB (ZEND_JIT_DEFAULT_BUFFER_SIZE) from the last segment, causing startup to fail with "Insufficient shared memory!". This patch increases SEG_ALLOC_SIZE_MAX to 64MB so the reserved JIT buffer fits in a single segment. Behavior on other platforms using mmap remains unaffected. Fixes #20718. --- ext/opcache/shared_alloc_shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/shared_alloc_shm.c b/ext/opcache/shared_alloc_shm.c index 09a357d189ed4..5c7c127722fe5 100644 --- a/ext/opcache/shared_alloc_shm.c +++ b/ext/opcache/shared_alloc_shm.c @@ -42,7 +42,7 @@ # define MIN(x, y) ((x) > (y)? (y) : (x)) #endif -#define SEG_ALLOC_SIZE_MAX 32*1024*1024 +#define SEG_ALLOC_SIZE_MAX 64*1024*1024 /* 64MB to match ZEND_JIT_DEFAULT_BUFFER_SIZE */ #define SEG_ALLOC_SIZE_MIN 2*1024*1024 typedef struct {