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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:47:30+00:00 2026-06-13T15:47:30+00:00

I want to see the System.OutOfMemoryException and the memory consumed in the task manager,

  • 0

I want to see the System.OutOfMemoryException and the memory consumed in the task manager, when the app is built against x64. There are two drop-downs in the Build tab in the app properties: “Platform target” and “Platform”, both are set to x64.

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<long> lst = new List<long>();
            while (true)
            {
                lst.Add(long.MaxValue);
            }
        }
    }
}

It is indeed showing OutOfMemoryException…but when it stops, the task manager is showing a number like 1587443K which is 1.5GB which would I expect if it was built against x86.
Yes, the operating system is 64bit.

Am I forgetting something else?

  • 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-13T15:47:31+00:00Added an answer on June 13, 2026 at 3:47 pm

    Am I forgetting something else?

    Yes – in .NET 4, there was still a 2GB-per-object limit. (You could use much more memory, but not in a single object.) I suspect your list needs to reallocate its internal buffer, requiring ~3GB in a single array.

    You may be pleased to hear that .NET 4.5 supports larger objects if you set the <gcAllowVeryLargeObjects> configuration parameter.

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

Sidebar

Related Questions

I want see the source code of System.Web.Routing.RouteValueDictionary class. But Reflector can't disassemble it
I want to see how g++ lays out memory for classes and virtual tables.
I want to see how much memory is allocated to my Java JVM on
I'm aware that .NET doesn't use complete physical memory availabe. I've encountered a System.OutOfMemoryException
I'm developing a user-system where I want to see if a user is online.
I want to see if a time I read from a db overlaps with
I want to see a list of all changes the next push would do.
I want to see the source of functions like ns_initparse(), res_search() etc. Where can
I want to see class, function and variable/property, dependencies visually, like NDepend , but
I want to see how my #include files be processed when Microsoft Visual Studio

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.