Manatee.Trello icon indicating copy to clipboard operation
Manatee.Trello copied to clipboard

Possible memory leak

Open Blood13 opened this issue 4 years ago • 1 comments

Hello. I'm using .net core 3.1 on windows. My app is pretty easy: it's get Board, then it's Members, then for each member it gets their cards, then it's calculate some metrics based on cards. Main() looks like:

while (true)
{
    var report = await service.GetStatAsync("[boardname]]");
    var printer = new ReportPrinter(report);
    printer.Print();
}

Everything ok, except of enormous memory consumption. I inspected it with dotMemory and that's what i've got: screenshot

I don't change default Manatee.Trello settings. GetStatAsync() looks like that:

var board = new Board(boardName);
await board.Refresh();
var members = board.Members;
await members.Refresh();
var filteredMembers = members.Where(c => developers.Keys.Contains(c.UserName)).ToList();
foreach (var filteredMember in filteredMembers)
{
    var cards = filteredMember.Cards;
    await cards.Refresh();
    ...
    do math
    ...
}

Any thoughts?

Blood13 avatar Jun 02 '20 07:06 Blood13

Yeah, it uses a lot of memory. That's partially due to caching all of the entities. On the other hand, the entities are cached so that you they're not duplicated.

Unfortunately, I don't really have much time to invest in this library right now. I'm happy to accept PRs, though.

gregsdennis avatar Jun 02 '20 08:06 gregsdennis