"Running into Memory Limitations: Resolving System.OutOfMemoryException in ASP.NET Web API Integrated with Angular

Currently, I am working on integrating Angular 2+ with asp.net Web API. The issue I am facing is related to dealing with a C# DataTable that is being returned to Angular 2+. To do this, I am utilizing the Post method.

The problem arises when I try to retrieve a large amount of data (85K+) from the asp.net Web API. Although the data fetches successfully, I encounter an error stating "System.OutOfMemoryException" in the browser. Consequently, I am unable to receive the data in Angular 2+.

I would appreciate any insights into what may be missing in my implementation and how I can effectively handle fetching all records efficiently in a single request.

Answer №1

After some experimentation, I discovered a different method for loading data. Instead of fetching all the information at once via HTTP in my asp.net web API, I decided to bring the data in packets using a customized observable. This approach not only solved my problem with memory overload but also successfully resolved the "system.outofmemoryException" error.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Managing dates in Visual Studio C# with Microsoft SQL Server databases

I am currently exploring the most efficient and seamless method to extract dates from the database and accurately parse/cast them within my DataAccessLayer (DAL) methods. The columns in my database are all of type date. In particular, I have defined this ...

Learn How to Implement Styling in Material UI using Styled Components

Utilizing styled-components with MaterialUI integration. Encountering the following error in LoginTextField component and seeking a resolution. Error Message: [ts] Type '{ width: number; }' is missing the following properties from type &apos ...

Encountering an issue with a custom hook causing an error stating "Attempting to access block-scoped variable 'X' before its declaration."

Currently, I am in the process of developing my initial custom hook. My confusion lies in the fact that an error is being displayed, even though the function is defined just a few lines above where it's invoked. Here is the relevant code snippet: f ...

The server is unable to receive lists that are included within the JSON object being passed in

Below are the data contracts utilized in the function. public class ResumeSkillsListDataContract : IResumeSkillsListDataContract { public IList<ISkillDataContract> KnownSkillsList { get; set; } public IList<ISkillDataContract> BadSkill ...

The final value of a loop is consistently returned each time

Creating a loop to generate objects. Action.ts public campaing:any = { 'id': '', 'campaing_code': '', 'campaing_type': '', 'start_date': this.currentDate, 'end ...

I attempted to execute an art configuration on Metaplex, but I keep encountering the same issue. Despite numerous attempts to modify various settings, the problem persists

Error encountered while compiling TypeScript code on desktop using ts-node to generate art configuration traits: Unable to find module 'commander' or its corresponding type declarations. Unable to find module '@project-serum/anchor' or ...

Issue arising from passing an object through a component in a Next.js application during build time when the object is retrieved from a database

Can anyone provide assistance with solving this issue? I have an object called "diary" coming from a database, which is passed to a component where a useState hook is expecting that object. During build time, the following error is occurring. An error is ...

Actively engage with an iframe by clicking from within using Actions in Selenium

Attempting to click a specific point within an iframe using the Actions class of Selenium is not working as expected. The code snippet I am using is: Actions action = new Actions(driver); action.MoveByOffset(x-coordinate, y-coordinate).Click().Perform(); ...

Deserializing JSON with nested objects causes parsing issues in .NET

Despite the numerous posts on similar situations, I have not been able to find a solution that works for me. It seems like my scenario is a bit unique. In my code, I have a class called PropertyValue which serves as a metadata class defining property valu ...

Ways of utilizing LINQ to sort data within specific groups

Is there a way (preferably using LINQ) to sort a collection that is naturally grouped, without changing the order of the groups themselves? Let me give an example. I have a collection like this: List<grpitem> list = new List<grpitem>( ...

Using Angular to include a forward slash "/" in the text input for a date field

Hello everyone, I am a newcomer to AngularJS and I am looking to insert slashes in an input type text element. I prefer not to rely on external packages like angular-ui or input type Date. My goal is to have the format mm/dd/yyyy automatically applied as ...

Encountering Typescript issues following the transition from npm to pnpm

Currently, I am facing a challenge in migrating an outdated Angular JS project from npm to pnpm. The main issue I am encountering is related to typescript errors, particularly the error message that states: error TS2339: Property 'mock' does not ...

ERROR: Unhandled promise rejection: Route cannot be found. URL Segment: 'details'

My current setup involves a router configuration in my Angular application. Below is the code snippet showcasing my router settings: import { Route, RouterModule } from '@angular/router'; import { ProjectDetailsComponent } from '../componen ...

What is the best way to showcase the outcome of a function on the user interface in Angular 2?

The code snippet below was originally in my .component.html file: <div class="someContainer"> <div class="text--bold">Display this please:</div> <div>{{ myObject.date ? '2 Jun' : 'Now' }}</div&g ...

The Angular framework's structure is loaded in a combination of synchronous and asynchronous ways once the primeng tableModule

Encountered this error while trying to load the TableModule from primeng into my components module file and running 'npm run packagr': Maximum call stack size exceeded To address this, I switched my primeng version from primeng12 to primeng11.4. ...

What is the reason for encountering a TypeScript error when using a union type?

interface Bird { age:string, eat:()=>any } interface Fish { age:string, swim:()=>any } type Pet = Fish | Bird; everything looks good so far, defining a Pet type const pet:Pet={ age:"sd", eat:()=>{} } when trying to return ...

Implementing cursor-based pagination in Next.js API Route with Prisma and leveraging the power of useSWRInfinite

I am working on implementing cursor-based pagination for a table of posts using Next.js API Route, Prisma, and useSWRInfinite. Currently, I am fetching the ten most recent posts with Prisma in a Next.js API Route and displaying them using useSWR, sorted b ...

Inform the Angular2 Component regarding the creation of DOM elements that are placed outside of the

The Challenge In my Angular2 project, I am using Swiper carousel and building it with Webpack. However, Angular2 adds random attributes like _ngcontent-pmm-6 to all elements in a component. Swiper generates pagination elements dynamically, outside of Ang ...

Holding off on completing a task until the outcomes of two parallel API requests are received

Upon page load, I have two asynchronous API calls that need to be completed before I can calculate the percentage change of their returned values. To ensure both APIs have been called successfully and the total variables are populated, I am currently using ...

Having trouble with my cshtml view not displaying properly

Currently, I am working with ASP.net MVC and the razor engine. On a particular page, there is a button that triggers an ActionResult in my controller using Ajax. Here's the code snippet for the Ajax call: $.ajax({ type: "GET", url: "/Home ...