Skip to main content
  1. About
  2. For Teams
Asked
Viewed 100 times
0

Background: I have a c# winform application that loads images every second and disposes them when they are not needed anymore.

I noticed in the task manager that the app fluctuates in memory use every few minutes. For example: the app will run at 14.1MB -> 14.2MB -> 14.3MB...some time passes...16.3MB....

Then 5 minutes later from 16.3MB the memory usage fluctuate like this: 16.3MB -> 25.3MB -> 16.1MB -> 25.2MB and will continue this pattern for 10 to 15 seconds before leveling out again at 14.0MB.

Sometimes I noticed the memory will also fluctuate down. For example: 14.6MB -> 10.4MB -> 14.7MB -> 11.5MB and so on for several seconds before leveling out again.

I know it is hard to say what the issue is without seeing the code but what would make this occur? Is this the GC running? Is it a memory leak? Is it something I should be worried about or does this happen often during application run-time? The app can run for several hours without crashing so it makes me wonder what is going on. I haven't ran it over 9 hours so I don't know what would happen then.

Let me know what you guys think and I appreciate any thoughts on the matter.

Thanks.

2
  • 1
    If you open up the Diagnostic Tools panel, it will show you when the GC kicks in (and when it doesn't, even if you thought it should). Your app doesn't seem to generate memory pressure in any way, so the GC may seem lazy, but you probably wouldn't like it to intervene more often. It doesn't work for free. You have a couple of jumps in memory usage, but this may not even strictly depend on your code. Which you didn't post, so that's all ;)
    Jimi
    –  Jimi
    2020-04-17 09:08:01 +00:00
    Commented Apr 17, 2020 at 9:08
  • Thanks for your input. I will do a little bit more testing and be sure to use the Diagnostic Tool. Thanks for your time!
    someuser193
    –  someuser193
    2020-04-20 00:15:29 +00:00
    Commented Apr 20, 2020 at 0:15

1 Answer 1

1

Is this the GC running?

Every time the system needs more memory and then the memory drops.

GC is NOT determinsitic. It runs when it needs to. Memory fluctuations are NORMAL.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the quick reply and reassurance. Much appreciated!

Your Answer

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.