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>() {
,
{ "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); }