-
Reduce memory usage?
I have an app which spends most of the time as an icon in the system tray with the form hidden. A timer control runs constantly with a one second interval and when a certain time period has elapsed the app does something.
It's currently using nearly 7.5 MB of memory while just waiting which seems rather a lot.
How can I reduce the figure?
Thanks
-
Re: Reduce memory usage?
I believe memory usage has nothing to do with activity of the program. A good place to start would to be to undeclare, or free variables not actually being used at the time, and/or unload un needed classes while waiting
-
Re: Reduce memory usage?
One other route would be to split the app into two parts. Have one part that does all of the processing tasks, and the other part that contains the scheduling part (ie. the systray icon and the timer). When the timer fires, have it launch the main application, do whatever it needs to do, then exit and wait for the next cycle.
-
Re: Reduce memory usage?
Does it use 7.5 MB as soon as it starts running, or does the memory usage keep going up as it runs? If the latter, you have a memory leak.