Re: GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Shelton

    Re: GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?

    On 2008-04-15, DR <softwareengine er98037@yahoo.c omwrote:
    GC.Collect() not cleaning memory, how to find out what references to lots of
    memory still exist?
    >
    When all my processign is done i set everything to null and then:
    GC.Collect()
    and then
    GC.WaitForPendi ngFinalizers()
    but it still shows that my process takes 400 MB of memory. Is there any easy
    way to see what references that I forgot to set to null so that the memory
    cleas up on GC.Collect() ?
    >
    >
    Where are you seeing that? In the task manager? If so, then you are
    looking in the wrong place. Let me tell you a little something about
    windows memory management - just because memory is freed, does not mean
    that the OS instantly removes it from your process.

    You need to be looking at the performance counters for this - to find
    out the actuall amount of memory your using....

    --
    Tom Shelton
  • kimiraikkonen

    #2
    Re: GC.Collect() not cleaning memory, how to find out what referencesto lots of memory still exist?

    On Apr 16, 1:08 am, Tom Shelton
    <tom_shel...@YO UKNOWTHEDRILLco mcast.netwrote:
    On 2008-04-15, DR <softwareengine er98...@yahoo.c omwrote:
    >
    GC.Collect() not cleaning memory, how to find out what references to lots of
    memory still exist?
    >
    When all my processign is done i set everything to null and then:
    GC.Collect()
    and then
    GC.WaitForPendi ngFinalizers()
    but it still shows that my process takes 400 MB of memory. Is there any easy
    way to see what references that I forgot to set to null so that the memory
    cleas up on GC.Collect() ?
    >
    Where are you seeing that?  In the task manager?  If so, then you are
    looking in the wrong place.  Let me tell you a little something about
    windows memory management - just because memory is freed, does not mean
    that the OS instantly removes it from your process.
    >
    You need to be looking at the performance counters for this - to find
    out the actuall amount of memory your using....
    >
    --
    Tom Shelton
    Hi,
    Recently, i downloaded a small GDI+ article about graphics, then first
    ran without looking source code, then what's that! My more than 500MB
    free memory was about to become out. Then i found out that the problem
    was using GC.SuppressFina lize before GC.Collect, removing
    GC.SuppressFina lize and lines about finalizing which solved the
    problem and GC.Collect was working good after this removal.

    Maybe that would be your problem,

    Hope this helps,

    Onur Guzel

    Comment

    • Scott M.

      #3
      Re: GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?

      As I replied in another NG. GC.Collect should only be used in the most
      memory intensive applicaitons. In practice, its use is not recommended.

      -Scott

      "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
      news:bbfafb62-bd22-420c-8357-d224fd807693@24 g2000hsh.google groups.com...
      On Apr 16, 1:08 am, Tom Shelton
      <tom_shel...@YO UKNOWTHEDRILLco mcast.netwrote:
      On 2008-04-15, DR <softwareengine er98...@yahoo.c omwrote:
      >
      GC.Collect() not cleaning memory, how to find out what references to
      lots of
      memory still exist?
      >
      When all my processign is done i set everything to null and then:
      GC.Collect()
      and then
      GC.WaitForPendi ngFinalizers()
      but it still shows that my process takes 400 MB of memory. Is there any
      easy
      way to see what references that I forgot to set to null so that the
      memory
      cleas up on GC.Collect() ?
      >
      Where are you seeing that? In the task manager? If so, then you are
      looking in the wrong place. Let me tell you a little something about
      windows memory management - just because memory is freed, does not mean
      that the OS instantly removes it from your process.
      >
      You need to be looking at the performance counters for this - to find
      out the actuall amount of memory your using....
      >
      --
      Tom Shelton
      Hi,
      Recently, i downloaded a small GDI+ article about graphics, then first
      ran without looking source code, then what's that! My more than 500MB
      free memory was about to become out. Then i found out that the problem
      was using GC.SuppressFina lize before GC.Collect, removing
      GC.SuppressFina lize and lines about finalizing which solved the
      problem and GC.Collect was working good after this removal.

      Maybe that would be your problem,

      Hope this helps,

      Onur Guzel


      Comment

      Working...