|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-07-19 11:02 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-07-19 11:02 UTC] cmb@php.net
[2021-08-01 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 07:00:01 2025 UTC |
Description: ------------ i run the code below in the cmd, it tooks warning Warning: shm_put_var(): not enough shared memory left in /usr/local/agent/bin/a.php on line 15 i set the shmmax > 100M when the process > 1 ,the error shows when the process = 1, it seems ok. Test script: --------------- #!/usr/local/services/php/bin/php <?php // Example $key = ftok(__FILE__, 'a'); $shm = shm_attach($key); shm_remove($shm); $shm = shm_attach($key); for($i = 0; $i < 3; $i++) { $pid = pcntl_fork(); if ($pid) { } else { //child $pid = posix_getpid(); for($i = 0; $i < 100000; $i++) { shm_put_var($shm, $pid, microtime(true)); } exit; } } ?> Actual result: -------------- Warning: shm_put_var(): not enough shared memory left in /usr/local/agent/bin/a.php on line 15