Hello,
Here is my scenario. I made a service that has a timer with an interval of 500ms.
When watching the task manager - I notice that every second or so my program uses 4 more kb of memory. I've even commented out all of the code in the timer - the memory usage still goes up (much slower though).
Obviously as a service this runs all day - after about a day the program is taking up several hundreds of MBs and continues to rise - it never hits a peak (starts off at about 30 MBs).
I'm disposing every object that has the option. I've read that on windows form applications - memory usage doesn't go down until the form is minimized. I copied my service code to a timer on a windows form and the memory would rise - until I minimized it and then the memory would go back down.
Basically - how can I get the memory usage down? It's almost like I need to minimize/maximize my application - but how can I do that if it is a service?
gc.Collect does nothing - (I've read that it releases the memory to .net, not windows). Is there a way to make my application release it's memory to windows?
How can I make my application release it's memory back to windows without restarting the service?
Thanks!
Here is my scenario. I made a service that has a timer with an interval of 500ms.
When watching the task manager - I notice that every second or so my program uses 4 more kb of memory. I've even commented out all of the code in the timer - the memory usage still goes up (much slower though).
Obviously as a service this runs all day - after about a day the program is taking up several hundreds of MBs and continues to rise - it never hits a peak (starts off at about 30 MBs).
I'm disposing every object that has the option. I've read that on windows form applications - memory usage doesn't go down until the form is minimized. I copied my service code to a timer on a windows form and the memory would rise - until I minimized it and then the memory would go back down.
Basically - how can I get the memory usage down? It's almost like I need to minimize/maximize my application - but how can I do that if it is a service?
gc.Collect does nothing - (I've read that it releases the memory to .net, not windows). Is there a way to make my application release it's memory to windows?
How can I make my application release it's memory back to windows without restarting the service?
Thanks!