|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-13 06:46 UTC] laruence@php.net
[2017-10-13 11:03 UTC] dmitry@php.net
[2017-10-13 11:03 UTC] dmitry@php.net
-Status: Open
+Status: Closed
[2017-10-13 12:10 UTC] spam2 at rhsoft dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 12:00:02 2025 UTC |
Description: ------------ It may happen that memory is allocated and freed in such a way that the allocation mmaps a new ZMM chunk and the deallocation immediately unmaps it again. The attached script demonstrates this issues. It will execute quickly up to a certain point (for me on master i=94) and then hang for a while. strace shows that during this time a sequence of mmap, madvise and munmap is repeated many times: mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3927400000 madvise(0x7f3927400000, 2097152, MADV_HUGEPAGE) = 0 munmap(0x7f3927400000, 2097152) = 0 This issue may be fixed by ensuring we always cache at least one chunk. Test script: --------------- <?php $bigArray = range(0, 256 * 1024 - 1); var_dump(memory_get_usage(true) / (1024*1024)); $array = []; for ($i = 0; $i < 1024; $i++) { echo "$i\n"; $array[] = range(0, 1023); for ($j = 0; $j < 16 * 1024; $j++) { $x = range(0, 1023); unset($x); } }