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. Memory Issue

Memory Issue

Scheduled Pinned Locked Moved C#
performancehelpquestiondiscussion
3 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.
  • T Offline
    T Offline
    tkemory
    wrote on last edited by
    #1

    Ok here is the scenario. I have an automated process manager that I am running, it is polling using the timer class every 10 minutes to see if something needs to be run. If the window is FormWindowState.Normal the memory is between 11 - 21 meg which is fine, when I minimize the window it drops memory useage to around 600k, which is great. However if I try to run GC after a poll and successful process run, the memory doesn't seem to get collected no matter what I try. I would expect memory to realease to at least 3 - 4 meg once the process is completed however when I call GC this doesnt happen, if I manually minimize the display the memory releases down to 600 - 800k. So I dont think I have references in place that should be there, its almost like GC doesnt fire until I minimize. Any thoughts?

    T I 2 Replies Last reply
    0
    • T tkemory

      Ok here is the scenario. I have an automated process manager that I am running, it is polling using the timer class every 10 minutes to see if something needs to be run. If the window is FormWindowState.Normal the memory is between 11 - 21 meg which is fine, when I minimize the window it drops memory useage to around 600k, which is great. However if I try to run GC after a poll and successful process run, the memory doesn't seem to get collected no matter what I try. I would expect memory to realease to at least 3 - 4 meg once the process is completed however when I call GC this doesnt happen, if I manually minimize the display the memory releases down to 600 - 800k. So I dont think I have references in place that should be there, its almost like GC doesnt fire until I minimize. Any thoughts?

      T Offline
      T Offline
      tkemory
      wrote on last edited by
      #2

      One other quick question is there an event that fires when FormWindowState property is changed? I cant find one in documentation but wanted to make sure I wasnt overlooking anything.

      1 Reply Last reply
      0
      • T tkemory

        Ok here is the scenario. I have an automated process manager that I am running, it is polling using the timer class every 10 minutes to see if something needs to be run. If the window is FormWindowState.Normal the memory is between 11 - 21 meg which is fine, when I minimize the window it drops memory useage to around 600k, which is great. However if I try to run GC after a poll and successful process run, the memory doesn't seem to get collected no matter what I try. I would expect memory to realease to at least 3 - 4 meg once the process is completed however when I call GC this doesnt happen, if I manually minimize the display the memory releases down to 600 - 800k. So I dont think I have references in place that should be there, its almost like GC doesnt fire until I minimize. Any thoughts?

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        well you cant really force the GC to run your just asking it to. implement the dispose method on those references and set them to null so you can force the release. make sure no other object holds a reference to it or it will not release. Much like the old com refernece counter. nick I'm not an expert yet, but I play one at work. Yeah and here too.

        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