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 8573203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:11:47+00:00 2026-06-11T19:11:47+00:00

In my C# program I do various memory-consuming operations. Depending on the amount of

  • 0

In my C# program I do various memory-consuming operations. Depending on the amount of memory currently available and various non-constant circumstances, the program fails with OutOfMemoryException at different stages.

I would like to stop processing at some point when it is more or less obvious that the program will fail with an OOM in the near future.

However, there is no fixed threshold for this; Other users may have more (or less) memory, another OS with its memory specifics and so on.

I do not want to just check that the software consumes more than eg 500MB as this may be too high or too low a restriction.

Is there any reliable way to predict an upcoming OOM in .NET?

  • 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-06-11T19:11:48+00:00Added an answer on June 11, 2026 at 7:11 pm

    MemoryFailPoint should do what you want.

    http://msdn.microsoft.com/en-us/library/system.runtime.memoryfailpoint.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++ program that benchmarks various algorithms on input arrays of different
Basically, I want to have my program retrieve various variables from the hard drive
The diff program, in its various incarnations, is reasonably good at computing the difference
For a program of mine I made a small function to clear the various
I want my program to change its window's caption in response to various user
OK, so I've read through various posts about teaching beginner's to program, and there
I'm implementing a program which gets text from various sites and checks which ones
I was making a program that rounds up numbers with various decimal places, so
Consider the program below. It has been simplified from a complex case. It fails
I have written a program which analyzes a project's source code and reports various

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.