Skip to content

Memory Leak with 4.0.5.3 (PHP 7.4) #106

Open
@kwhat

Description

@kwhat

There appears to be a memory leak:

Sample Code:

<?php

function test() {
    echo memory_get_usage() . "\n";
    
    $memcache_obj = new Memcache();
    $memcache_obj->addServer('memcached.local' , 11211);
    
    echo memory_get_usage() . "\n";
    
    // None of this seems to make a difference.
    //$memcache_obj->close();
    //unset($memcache_obj);
}

while (true) {
    test();
    sleep(1);
}

Actual Output:

# php -f test.php 
392128
408184

405160
421136

418112
434408

431384
447360

444336
460312

457288
473264

470240
486216

483192
499168

496144
512120

509096
525072

Expected Output:

# php -f test.php 
392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

392128
408184

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions