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. .NET (Core and Framework)
  4. Query with Garbage Collection

Query with Garbage Collection

Scheduled Pinned Locked Moved .NET (Core and Framework)
questiondatabasedata-structuresperformance
5 Posts 5 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.
  • R Offline
    R Offline
    Rahul Hanumant Chavan
    wrote on last edited by
    #1

    I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

    L Richard Andrew x64R P D 4 Replies Last reply
    0
    • R Rahul Hanumant Chavan

      I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1. When the object goes out of scope, is disposed or otherwise has no references to it, it can be garbage collected. 2. The reference counter tells GC when it is ready to be swept up. 3. Not sure what that means.

      1 Reply Last reply
      0
      • R Rahul Hanumant Chavan

        I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Rahul Hanumant Chavan wrote:

        1. What is the need of three garbage collector generation?

        The need is so that the GC can optimize its behavior. It can be reasonably sure that older generations will not need to be collected.

        The difficult we do right away... ...the impossible takes slightly longer.

        1 Reply Last reply
        0
        • R Rahul Hanumant Chavan

          I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          This is too big a topic to answer in a simple forum query - I suggest that this article[^] would be a valuable place to start your further reading.

          This space for rent

          1 Reply Last reply
          0
          • R Rahul Hanumant Chavan

            I was reading article on Garbage Collection. I have below queries- 1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect? 2) Is there any property in object that tells GC that it can collect that object? 3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

            D Offline
            D Offline
            Dmitriy Gakh
            wrote on last edited by
            #5

            Quote:

            What is the need of three garbage collector generation? Where are these generations located(physical or logical)?

            Different generations need to manage different kinds of objects. Small objects created locally in functions have small live time and small size. They should be controlled in different way comparing to big objects with high live time. Number of generations depends on GC realization. Physical or logical - I do not understand exactly what do you mean, but if GC uses virtual memory it can be considered as logical.

            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