Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6123679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:02:41+00:00 2026-05-23T16:02:41+00:00

I have an application that works with large amounts of data, and I’m thinking

  • 0

I have an application that works with large amounts of data, and I’m thinking that, may be, sometimes the OutOfMemoryException will be thrown (For half a year, I got no single exception, but I’m just want to know all about it). As I’ve investigated, after this exception I can’t proceed with execution of my program.

Is there any good pattern to handle such exceptions, especially to working with IDisposable classes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:02:42+00:00Added an answer on May 23, 2026 at 4:02 pm

    In a genuine OOM scenario (more likely on x86 than x64) you are pretty doomed there. Almost anything would cause an allocation, so your best option is to die as quickly and elegantly as possible, doing minimum harm.

    Since it isn’t happening, don’t stress overly, but avoidance is better than handling here:

    • use streaming data APIs rather than buffering everything in memory
    • re-use buffers etc
    • avoid enormous arrays/lists/etc (in truth, the most likely way to cause an OOM is to request an enormous (but single) array) – for example, a jagged array scales better than a 2D array (even on x64 there is a hard limit on the maximum size of a single array)
    • think about how you handle sparse data
    • do you read lots of strings from external sources? If so, consider around a custom interner so you don’t have 20,000 different copies of common strings (country names, for example)
    • keep an eye on what you release when
    • avoid accidentally prolonged life on objects, especially via event subscriptions (notorious for accidental extensions to lifetimes)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application project that works with a quite large database (over
We have a web application that needs to process a large amount of data
I have an Java application for copying large amounts of data from users' workstations
I have a web application that works in our stage/test environment fine but once
I have an application that perfectly works on iPhone os 2.2.1 but when I
We have a C# application that works fine on windows XP and windows vista
I have an application that is works fine and the JFrame for it is
I have a C++ application that works and compile perfectly. I can execute and
I have a Rails application that works with mongodb. I want to deploy it
I have an application on appspot that works fine through regular browser, however when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.