Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-257

Terrible memory leak in cochbase 2.1.0 node library

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 2.1.1
    • 2.1.0
    • library
    • Security Level: Public
    • Tested on Linux and OS X, Couchbase Server 3.0.1 (CE) and Couchbase Server 4.0 RC0

    Description

      Couchnode 2.1.0 leaks memory when reading and saving data to/from the database. Finally blews up every server with out-of-memory exception.

      Simple Testscript attached. (stores some data in the DB, reads it, stores it again ...

      Expected output (created with couchnode 2.0.12) - Constant memory consumption (~10MB):

      { rss: 48062464, heapTotal: 30578176, heapUsed: 10547920 } { rss: 48648192, heapTotal: 30578176, heapUsed: 10773632 } { rss: 48898048, heapTotal: 30578176, heapUsed: 10323608 } { rss: 50057216, heapTotal: 47355392, heapUsed: 9964304 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9827288 } { rss: 63488000, heapTotal: 47355392, heapUsed: 9797456 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9802408 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9799208 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9809688 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9803280 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9806344 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9802552 } { rss: 64352256, heapTotal: 47355392, heapUsed: 9796584 }

      Output with couchnode 2.1.0 - increasing memory consumption (> 1GB in less than 3min !):

      { rss: 125153280, heapTotal: 117527040, heapUsed: 70811952 } { rss: 192856064, heapTotal: 188730624, heapUsed: 135692376 } { rss: 259080192, heapTotal: 260966144, heapUsed: 202408480 } { rss: 325832704, heapTotal: 333201664, heapUsed: 267726488 } { rss: 393379840, heapTotal: 405437184, heapUsed: 334342904 } { rss: 460029952, heapTotal: 476652800, heapUsed: 401276184 } { rss: 528195584, heapTotal: 549920256, heapUsed: 469288536 } { rss: 597360640, heapTotal: 625251584, heapUsed: 537122128 } { rss: 602099712, heapTotal: 699550976, heapUsed: 603260056 } { rss: 598962176, heapTotal: 772818432, heapUsed: 668073568 } { rss: 548777984, heapTotal: 824415232, heapUsed: 717452512 } { rss: 591093760, heapTotal: 899746560, heapUsed: 782949784 } { rss: 650620928, heapTotal: 971982080, heapUsed: 851758288 } { rss: 708751360, heapTotal: 1046281472, heapUsed: 917672512 } { rss: 689205248, heapTotal: 1118516992, heapUsed: 986412472 } { rss: 757903360, heapTotal: 1207263488, heapUsed: 1063480088 }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              brett19 Brett Lawson
              pbihler pbihler
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty