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

The Archive Base Latest Questions

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

Is the memory from primitive data types (int, char,etc) immediately released once they leave

  • 0

Is the memory from primitive data types (int, char,etc) immediately released once they leave scope, or added to garbage collection for later release?

consider:

For x as integer=0 to 1000 dim y as integer Next 

If this doesn’t add 1000 integers to the garbage collector for clean up later, how does it treat string objects? would this create 1000 strings to clean up later?

For x as integer=0 to 1000 dim y as string='' Next 

How about structures that contain only int,string,etc… data types?

Classes that contain only managed resources?

  • 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-11T02:49:31+00:00Added an answer on May 11, 2026 at 2:49 am

    Okay, with only two answers there’s already misinformation…

    • String isn’t a primitive type
    • String isn’t a value type
    • Value type values aren’t always created on the stack – it depends on where the variable is. If it’s part of a class, it’s stored on the heap with the rest of the data for that object.
    • Even local variables can end up on the heap, if they’re captured (in anonymous functions and iterator blocks for example)
    • String literals such as ” are interned – they always resolve to the same string. That loop doesn’t actually create any strings.

    For more info, see my article on what goes where in .NET memory. You might also want to consider whether it’s important or not.

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

Sidebar

Related Questions

In C++ the storage class specifier static allocates memory from the data area. What
I'm attempting to use TinyXML to read and save from memory, instead of only
In your opinions, is it better to return a newly allocated memory stream from
I want to store a large result set from database in memory. Every record
I have a byte array in memory, read from a file. I would like
I am trying to find out how much memory my application is consuming from
When we start up Weblogic (8.1) from the command line, we’re passing it memory
I'm trying to eliminate memory leaks from my project, but i'm stuck in 2
i want to deallocate a spriteClass from memory and remove it from the display
What memory leak detectors have people had a good experience with? Here is a

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.