You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stdlib: memory_get_usage()/memory_get_peak_usage() real_usage peaks must dominate emalloc (zend_alloc.c) #4933
When real_usage=true, Zend reports malloc/system memory (RSS / zend_mm_heap real size). The emalloc subset (real_usage=false) is always ≤ the real peak in normal processes.
VmMemory currently uses RSS for both code paths (readEmallocApprox() calls readRssBytes()), so peaks are tracked in separate counters from the same source and ordering breaks:
=emalloc: ', ($ur >= $u ? 'true' : 'false'), PHP_EOL;
echo 'peak real>=emalloc: ', ($pur >= $pu ? 'true' : 'false'), PHP_EOL;
\`\`\`
Zend prints both `true`; VM currently prints both `false` when `VmMemory` maps both paths to RSS.
claim released: repro green on master — both memory_get_usage(true) >= memory_get_usage(false) and peak ordering return true on VM (Docker php-env). VmMemory already uses MemoryAccounting for emalloc and RSS for real_usage. Pivoting.
Activity
PurHur commentedon Jun 3, 2026
Repro script (add under
test/repro-maintainer/)```php
=emalloc: ', ($ur >= $u ? 'true' : 'false'), PHP_EOL; echo 'peak real>=emalloc: ', ($pur >= $pu ? 'true' : 'false'), PHP_EOL; \`\`\` Zend prints both `true`; VM currently prints both `false` when `VmMemory` maps both paths to RSS.PurHur commentedon Jul 12, 2026
claim: worker-lane-b — starting this run
PurHur commentedon Jul 12, 2026
claim released: repro green on master — both
memory_get_usage(true) >= memory_get_usage(false)and peak ordering return true on VM (Docker php-env). VmMemory already uses MemoryAccounting for emalloc and RSS for real_usage. Pivoting.PurHur commentedon Jul 17, 2026
claim: worker-lane-b — verifying prior fix / closing if green
Trust gates (master):
php script/bootstrap-inventory.php --check→ OK 5310/5310./script/release-readiness.sh --json→user_release_ready: yes(inventory, spine, north-star5-fast, vm-driver-probe all ok)Repro (Docker
php-env):Inline probe matches prior release comment (2026-07-12):
VmMemoryalready separates emalloc vs RSS. Closing as done.PurHur commentedon Jul 17, 2026
Closed: done-when already met on master (no PR needed).
Verified 2026-07-17 in Docker:
memory_get_usage(true) >= memory_get_usage(false)→ true (VM + Zend)memory_get_peak_usage(true) >= memory_get_peak_usage(false)→ true (VM + Zend)Prior worker note (2026-07-12) was correct — dual counters via MemoryAccounting/RSS.