Memory steadily increases with DispatcherTimer until app crash on Windows
Phone 8
I am currently writing a Stopwatch and Timer app that works by subtracting
a start time from the current time and refreshes a textbox as such with a
DispatcherTimer. After analyzing my memory usage for the app I found that
it kept steadily increasing until the app finally crashed due to too much
memory being used. I tried running GC.Collect() in my TimerTick event
handler, however, it doesn't seem to do anything. Collecting garbage once
the DispatcherTimers are stopped is not feasible because they need to run
for as long as the user sets them for, and the problem occurs when the
DispatcherTimers are still needed. If GC.Collect doesn't work, I don't
really know what else I can do to keep my memory down from the use of a
DispatcherTimer. Any ideas?
Thanks in advance!
No comments:
Post a Comment