|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61008 not enough shared memory left
Submitted: 2012-02-08 10:32 UTC Modified: 2021-08-01 04:22 UTC
Avg. Score:4.0 ± 1.0
Reproduced:9 of 9 (100.0%)
Same Version:4 (44.4%)
Same OS:0 (0.0%)
From: shenkong at qq dot com Assigned: cmb (profile)
Status: No Feedback Package: Semaphore related
PHP Version: 5.3.10 OS: CentOS 6.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 + 39 = ?
Subscribe to this entry?

 [2012-02-08 10:32 UTC] shenkong at qq dot com
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:
// Example
$key = ftok(__FILE__, 'a');
$shm = shm_attach($key);
$shm = shm_attach($key);
for($i = 0; $i < 3; $i++) {
    $pid = pcntl_fork();
    if ($pid) {
    } else {
        $pid = posix_getpid();
        for($i = 0; $i < 100000; $i++) {
            shm_put_var($shm, $pid, microtime(true));

Actual result:
Warning: shm_put_var(): not enough shared memory left in 
/usr/local/agent/bin/a.php on line 15


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-19 11:02 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-19 11:02 UTC]
Is this still an issue with any of the actively supported PHP

[1] <>
 [2021-08-01 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 01:03:48 2022 UTC