Skip to content

Memory leak #514

@Lisio

Description

@Lisio

Description

Driver causes memory leak for the collections with at least 9998 docs (9997 docs work fine).

Environment

Ubuntu 16.04 x64
PHP 7.1.0
mongodb 1.2.3

$ php -i | grep -E 'mongodb|libmongoc|libbson'
mongodb
libbson bundled version => 1.5.3
libmongoc bundled version => 1.5.3
libmongoc SSL => enabled
libmongoc SSL library => OpenSSL
libmongoc crypto => enabled
libmongoc crypto library => libcrypto
libmongoc crypto system profile => disabled
libmongoc SASL => disabled
mongodb.debug => no value => no value

Test Script

<?php

$mongo = new \MongoDB\Driver\Manager("mongodb://username:password@127.0.0.1:27017/dbname");
$query = new \MongoDB\Driver\Query([]);

while (true) {
    $mongo->executeQuery('dbname.test', $query)->toArray();
    echo memory_get_peak_usage() . PHP_EOL;
}

Debug (9997 docs): http://kostin.info/9997.zip (1.5Mb)
Debug (9998 docs): http://kostin.info/9998.zip (1.5Mb)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions