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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:36:24+00:00 2026-06-13T13:36:24+00:00

I read about CLR in .NET as: When CLR loads heap is partitioned in

  • 0

I read about CLR in .NET as:

When CLR loads heap is partitioned in SOH and LOH.

  1. when application is started at that time heap is allocated by CLR to application depending on its size.

  2. LOH heap has Gen0,Gen1,and Gen2 regions.

Here all objects for A class are allocated on Gen0,

Questions

  1. How CLR knows the size will occupied by application in heap?
  2. Suppose there is 4K heap memory allocated by CLR for Gen0 region. Given the code below, is it possible for this single thread to use full 4K memory on Gen0?

    collect = new List();
    while(true)
    {
        collect.Add(new A());
        new A();
        new A();
    }
    
    class A
    {
        int a = 0, b = 0;
    }
    
  • 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-13T13:36:25+00:00Added an answer on June 13, 2026 at 1:36 pm
    1. I believe this is done by calculating a size of all declared fields surely considering its types. For more detaikls see MSDN “Allocating Memory”
    2. Regarding MSDN paper “Automatic Memory Management” all new objects (as Brian Rasmussen noted in comments below – generations are applicable for SOH only, large objects created in LOH is not generational healp) initially created in Gen0 and only those which survives while application’s life will be moved to Gen1. But it is mentioned that in case when Gen0 is full – GC performs garbage collection to clean up Gen0 and if it is still full – all new objects will be created in Gen1.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read an article about using CLR integration in sqlserver and was wondering what
I read about an inheritance feature in PostgreSQL that seemed pretty neat. Unfortunately I
I read the following paragraph on Wikipedia article about the CLR: Alternatively, the CIL
I have read about POCO (Plain old CLR (or C#) object) here ,and confused
Problem I'm trying to create an CUDA application that is well integrated with .net.
I've read about this issue on MSDN and on CLR via c#. Imagine we
I read some articles about Application Domain.The deep reading finally resulted in whirling confusion.So
I have read about Generations and the Large Object Heap, but I still fail
slightly different question about variance this time. I take it from experimentation that C#
I read about a string/word that did so the Routing crashed but I can't

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.