OData / OData/AspNetCoreOData

Memory Leak 8.2.2 when using Odata to communicate with Business Central

Open
#1,371 6 comments 0 reactions 1 assignee View on GitHub

@corranrogue9 is already working on this.

Since Dec 10, 2024.

bug P1
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Our project is using .NET8
Odata 8.2.2

When running our project, each time the code does retrieves or saves data in Business Central through Odata the memory usage goes up without ever coming down:

var newOrderQuery = new DataServiceCollection<MtSalesInvoice>(_mtApiContext.MtSalesInvoices.Where(s => s.Id == new Guid("11111111-1111-1111-1111-111111111111")));
 var newOrder = new MtSalesInvoice();
 newOrderQuery.Add(newOrder);
 newOrder.CustomerNumber = existingCustomer.Number;
 newOrder.InvoiceDate = DateTime.Now.Date;
 newOrder.UniqueReference = locator;
 newOrder.IsMarkedForInvoiceCheck = operation.Order.IsMarkedForInvoiceCheck;
 _mtApiContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

 _mtApiContext.Detach(newOrderQuery);

image

looking at memory heap most of it not all memory is being taken by Odata.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.