Repository navigation
Fix GH-25555: Set memory_consumption when loading file_cache script into SHM - #25583
prateekbhujel wants to merge 1 commit into
Conversation
…t into SHM When a script is written to opcache.file_cache without being stored in shared memory (because SHM was full or opcache.file_cache_only=1 was active), script->dynamic_members.memory_consumption in the serialized .bin file is 0. When zend_file_cache_script_load_ex() later loads that .bin into shared memory (cache_it == true), initialize script->dynamic_members.memory_consumption to ZEND_ALIGNED_SIZE(script->size) so opcache_get_status() reports the allocated SHM size and invalidation accounts for it in wasted_memory. Closes phpGH-25555.
|
AI-assisted testing and drafting.
|
When a script is written to
opcache.file_cachewithout being stored in shared memory (because SHM was full oropcache.file_cache_only=1was used),script->dynamic_members.memory_consumptionin the serialized.binfile is0.When
zend_file_cache_script_load_ex()later loads that.bininto shared memory (cache_it == true), setscript->dynamic_members.memory_consumption = ZEND_ALIGNED_SIZE(script->size)soopcache_get_status()reports the allocated SHM size and invalidation accounts for it inwasted_memory.Fixes GH-25555.