Memory leak in .net application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Geek OnDemand
    New Member
    • Oct 2011
    • 1

    Memory leak in .net application

    Hi

    I am working on a desktop application in VB.net 2005. The application contains a timer with an interval of 1 min. Each time the timer ticks, a set of functions gets executed, mostly database related.
    Initially the application runs fine. In processes(Task manager) the cpu usage goes to 100% every time the timer is invoked. But the timespan is around 1 sec(negligible) .
    However as the time passes and after around 20 hours the time span of timer_tick increases to something like 20-30 secs. In this period cpu usage is 100% and the application does not responds. Gradually the time span of timer_tick increases to 1 min and the cpu uses gets stuck to 100% and the application does not responds.
    All objects are properly disposed.
    Moreover, this issue is with pentium 4 processors. The application runs fine on core 2 duo.

    Looking forward for help. Thanks in advance.
  • !NoItAll
    Contributor
    • May 2006
    • 297

    #2
    We really need to see code to help you out here but here are a few things to look for:

    1. Check scope on any objects you create within the timer and the methods called within the timer. If you are rediming a global array anywhere then it is simply growing and growing and growing.
    2. As above - make sure you object.dispose
    3. If you are opening db connections be sure to close AND dispose, just closing will not release the resources

    Comment

    Working...