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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:01:09+00:00 2026-05-18T01:01:09+00:00

everyone… I’m new to C# and such languages… I’ve read two articles by Skeet,

  • 0

everyone… I’m new to C# and such languages…

I’ve read two articles by Skeet, one about heap/stack, and other about reference types and value types. And I assume my question is simple, but it’s not clarified to me after reading those articles.

Do reference types allocate new memory when passed to methods?

For example, if I pass a Form to a method, like

void myMethod(System.Windows.Forms.Form myForm)
{
...
}

Will there be more memory allocated to store all myForm data or will it hold just a reference to where myForm data is already allocated?

My worry is that if there’s more memory allocated to store everything “appended” to myForm, soon the memory could become full, if myForm were a big form…

  • 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-05-18T01:01:10+00:00Added an answer on May 18, 2026 at 1:01 am

    When you instantiate your original form, the form object will allocated on the heap. When you call myMethod, you’re passing a reference type (essentially a pointer to that object) by value. That means that the reference you’re passing in will be copied in the context of myMethod – this involves a 32/64 bit stack allocation, depending on your architecture.

    So, to answer your question, your form will not be copied but the reference to it will be.

    Disclaimer: I haven’t used C# in ages.

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

Sidebar

Related Questions

Everyone likes to talk about reusability. Where I work, whenever some new idea is
everyone. Can someone share some links on articles about back end caching and fragment
Everyone knows? about avatar url in tumblr api / read / json? like for
everyone..i want after i type 0203-ED in textfield ...two character behind that text can
everyone The problem is if there exists two exported components which have the same
everyone. I'm new here and this is my first post. I'm creating a simple
Everyone made such short work of my first question, now I'm stumped with another
everyone. I have a rookie question about the returning value in java. Here's my
Everyone, I am trying to do read more feature with JQuery's slideToggle thing but
everyone, I have some question about C++, what do You actually prefer to use

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.