Skip to content

Commit d2ca471

Browse files
committed
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.
1 parent 9b33be2 commit d2ca471

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/shared_alloc_shm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# define MIN(x, y) ((x) > (y)? (y) : (x))
4343
#endif
4444

45-
#define SEG_ALLOC_SIZE_MAX 32*1024*1024
45+
#define SEG_ALLOC_SIZE_MAX 64*1024*1024 /* 64MB to match ZEND_JIT_DEFAULT_BUFFER_SIZE */
4646
#define SEG_ALLOC_SIZE_MIN 2*1024*1024
4747

4848
typedef struct {

0 commit comments

Comments
 (0)