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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:11:49+00:00 2026-05-11T05:11:49+00:00

Is there a way to find how much memory is used for a particular

  • 0

Is there a way to find how much memory is used for a particular object? For example a List. Taking everything into account, like string interning and whatever is done by compiler/runtime environment/whatever.

  • 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. 2026-05-11T05:11:50+00:00Added an answer on May 11, 2026 at 5:11 am

    You’d really have to define exactly what you meant by ‘how much memory is used for a particular object’. For instance, you could mean ‘if this object were garbage collected, how much would be freed’ – or you could mean ‘how much memory does this object and everything it touches take up.’

    Your point about string interning is a good example. Suppose you do:

    List<string> internedStrings = new List<string>(); List<string> nonInternedStrings = new List<string>(); for (int i=0; i < 1000; i++) {     string tmp = new string(' ', i+1);     nonInternedStrings.Add(tmp);     tmp = tmp.Intern();     internedStrings.Add(tmp); } 

    Does nonInternedStrings really take up more memory than internedStrings? If internedStrings were garbage collected, it wouldn’t free as much memory – but if internedStrings had never been created (including not interning each of its elements) then more memory would never have been required.

    If you can be more specific about exactly what you mean, we may be able to help you. It’s a complex issue though.

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

Sidebar

Related Questions

Is there any way to find out how much memory is available in iOS?
Is there a tool or a way to find out how much memory consumed
Is there any way to find the number of bytes of memory that are
Is there a way to find out how much space (on disk) a row
I am trying to find a way to determine at run-time how much memory
I would like to find out or at least estimate how much memory does
Is there a way to find out if a light is enabled in GLSL
is there a way to find all script files added to a page in
Is there a way to find ILDASM.exe from Visual Studio 2008 ? I know the location
Is there a way to find what architecture an ant script is running on?

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.