Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-894

BSON get_properties handlers leak during gc_possible_root() checks

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.4
    • Affects Version/s: 1.2.3
    • Component/s: None
    • None
    • Environment:
      Ubuntu 16.04 x64
      PHP 7.1.0

      The following code shows memory leakage for collection that has more than 9997 docs.

      $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;
      }
      
      db.test.drop(); for (var i = 0; i < 9998; ++i) {db.test.insert({x: "y"});}
      
      $ php index.php 
      15881112
      17801272
      19720888
      21640504
      23560120
      25479736
      27399352
      29318968
      31238584
      33158200
      35077816
      36997432
      38917048
      40836664
      42756280
      44675896
      46595512
      48515128
      50434744
      
      db.test.drop(); for (var i = 0; i < 9997; ++i) {db.test.insert({x: "y"});}
      
      $ php index.php 
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      15880312
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            lisio Andrey Kostin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: