Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-580

Native memory leak when save document repeatedly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.7.1
    • 2.5.0
    • .NET
    • Security Level: Public
    • None
    • CBL Sprint 13
    • 3

    Description

       https://github.com/couchbase/couchbase-lite-net/issues/1196

      CouchbaseLite/2.6.0 (.NET; UWP 10.0.18363.476; Dell Inc. XPS 15 9570) Build/129 LiteCore/2.6.0 (2193) Commit/e715812a

      Library Version

      2.6.0 (2193)

      .NET Runtime

      UWP 10.0.18363.476

      Operating System / Device Details

      Windows 10 Enterprise

      Expected behavior

      The reproduction project should run indefinitely without running out of memory.

      Actual behavior

      The native heap size climbs rapidly as the reproduction project continues to insert records. This can be seen when running the project in Visual Studio 2019 and observing the diagnostic tools.

      Steps To Reproduce

      Run the supplied reproduction project. The reproduction project does the following:
      var directoryPath = Path.GetTempPath(); while (true) { // asynchronously insert a record into the database await Task.Run(() => { var timestamp = DateTime.UtcNow; // create the record to be stored var record = new Dictionary<string, object>() {

      { "Timestamp", timestamp.Ticks }

      ,

      { "Value", "test" }

      }; var config = new DatabaseConfiguration()

      { Directory = Path.Combine(directoryPath) }

      ; // create the database using (var db = new Database(name: "MyDatabase", config)) { // convert the record to a mutable document and save it using (var document = new MutableDocument(timestamp.Ticks.ToString(), record))

      { db.Save(document); }

      } }).ConfigureAwait(false); // wait briefly before inserting another record await Task.Delay(10).ConfigureAwait(false); }

      Attachments

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

        Activity

          People

            sandy.chuang Sandy Chuang (Inactive)
            sandy.chuang Sandy Chuang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty