Skip to content

Memory leak #865

@panterlo

Description

@panterlo

Describe the bug
A clear and concise description of what the bug is.

A memory leak seems to be present.

using var session = _memgraphDriver.AsyncSession(conf => conf.WithDatabase("ABC"));
var cursor = await session.RunAsync(query);
var allRecords = await cursor.ToListAsync(); // Causes memory leak
await session.CloseAsync();

To Reproduce
Steps to reproduce the behavior:

  1. Add the following code with a query that returns a few thousand nodes
using var session = _memgraphDriver.AsyncSession(conf => conf.WithDatabase("ABC"));
var cursor = await session.RunAsync(query);
var allRecords = await cursor.ToListAsync(); // Causes memory leak
await session.CloseAsync();
// Optional - doesn't not affect memory leak await session.DisposeAsync();
// Optional - doesn't not affect memory leak await _memgraphDriver.DisposeAsync();
  1. Run the method several times inspecting the memory growth
    Memory will continue to grow for each method call

Expected behavior
A clear and concise description of what you expected to happen.

Memory will quickly grow as in our query example it grows with 400 MB per method call.

Version Info (please complete the following information):

  • .NET Version: .NET Core 8.0
  • .NET Driver Version 5.28.3 (also tested earlier versions down to 5.27.0)

Additional context
Add any other context about the problem here.

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