locked
Flushing the memory before running RRS feed

  • Question

  • Hello,
     
    Do anyone know how I can flush the memory before my application runs. Ideally, I would like a VB.net code for this. Thanks.
    Tuesday, February 5, 2008 7:31 AM

Answers

  • Hi Angelina,

     

    actually it is hard to give you a good general advice here, because it depends on your application to find possible problems.

    A thing I sometimes to when my application reacts slowly or seems to hang: I push the PAUSE button in the debugger of VS and the the marker jumps to the line where the application is currently working. This might reveal bad loops.

     

    But you have to accepts that if you have a lot to do on a slow machine it takes a lot of time... Maybe the hints provided in this post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2684283&SiteID=1 also work for you. But if you don't get it running you have to deep analyse your code - especially maybe your event handling on Resize, Paint, Move,... and similar events. It may be that just one poor line of code in one of the controls slows the whole thing down...

     

    Good Luck, Daniel

     

    Thursday, February 7, 2008 8:50 AM

All replies

  • What do you exactly mean by "flushing the memory"? Usually you don't have access to memory other than that your application itself is using. So to get some more memory for your application you have to kill other tasks or tell the user to go to the computer store and buy another bar of memory for his machine Wink

     

    Tuesday, February 5, 2008 12:11 PM
  • You should always initialize variables before using them:

     

    Dim i As Integer = 0

    Dim o As Object = Nothing

    Tuesday, February 5, 2008 1:30 PM
  • Thanks to BrainWasher and Steve D for your inputs. A bit of clarification - Whenever I run my application it unusually takes longer period of time for the form to paint and the code to activate. When activated the menus and submenus too, drags and sometimes hangs! I have tried tidying up the code by clearing unwanted lines of code and this has not helped my cause. Any ideas please.
    Tuesday, February 5, 2008 9:24 PM
  • Hi Angelina,

     

    actually it is hard to give you a good general advice here, because it depends on your application to find possible problems.

    A thing I sometimes to when my application reacts slowly or seems to hang: I push the PAUSE button in the debugger of VS and the the marker jumps to the line where the application is currently working. This might reveal bad loops.

     

    But you have to accepts that if you have a lot to do on a slow machine it takes a lot of time... Maybe the hints provided in this post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2684283&SiteID=1 also work for you. But if you don't get it running you have to deep analyse your code - especially maybe your event handling on Resize, Paint, Move,... and similar events. It may be that just one poor line of code in one of the controls slows the whole thing down...

     

    Good Luck, Daniel

     

    Thursday, February 7, 2008 8:50 AM