Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. when the class is loaded in c#?

when the class is loaded in c#?

Scheduled Pinned Locked Moved C#
questioncsharpperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shashank veerkar
    wrote on last edited by
    #1

    hi.. i have some question .. first one is i want to know when the class is loaded first time in c#? is it at compile time or at run time? and how? and where the memory is allocated to the class? and when the memory allocated for static fields ? and how?

    C 1 Reply Last reply
    0
    • S shashank veerkar

      hi.. i have some question .. first one is i want to know when the class is loaded first time in c#? is it at compile time or at run time? and how? and where the memory is allocated to the class? and when the memory allocated for static fields ? and how?

      C Offline
      C Offline
      Chandana Subasinghe
      wrote on last edited by
      #2

      Hi Every static variable is stored on the heap, regardless of whether it's declared within a reference type or a value type. There is only one slot in total no matter how many instances are created. (There don't need to be any instances created for that one slot to exist though.) Note that this heap is separate from the normal garbage collected heap - it's known as a "high frequency heap", and there's one per application domain. For further reference please look this article http://www.developerfusion.co.uk/show/4705/2/[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups