Memory release after form close

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • touf

    Memory release after form close

    HI,
    In my windows application (VB.NET) when I open a form the memory is
    increasing but When I close it the memory doen't decrease (task manager).
    each time I close the form and re-open it the memory is increasing.
    with the time the machine (512 MO) become slow.
    Is there a way to release the memory when closing the form.
    Thanks


  • Michael D. Ober

    #2
    Re: Memory release after form close

    "touf" <touiss@hotmail .comwrote in message
    news:%231LrT2$0 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
    HI,
    In my windows application (VB.NET) when I open a form the memory is
    increasing but When I close it the memory doen't decrease (task manager).
    each time I close the form and re-open it the memory is increasing.
    with the time the machine (512 MO) become slow.
    Is there a way to release the memory when closing the form.
    Thanks
    >
    Do you have any variables in your form that you reference outside the form.
    If so, it may be that these variables are being recreated and then
    rereferenced every time you open the form but because they are referenced
    outside the form they're not being released when you close them.

    Mike.


    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Memory release after form close

      Touf,

      The taskmanager is far from acurate, beside that, what is the problem with
      used memory as there is enough to use.

      As it is because of your systemadministr ator, then search for this on Google
      while using the name Posseth, he has a nice routine (which spent some time),
      that keeps system administrators happy. (It is not releasing more memory, as
      it is often already released but not showed in taskmanager).

      Cor

      "touf" <touiss@hotmail .comschreef in bericht
      news:%231LrT2$0 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
      HI,
      In my windows application (VB.NET) when I open a form the memory is
      increasing but When I close it the memory doen't decrease (task manager).
      each time I close the form and re-open it the memory is increasing.
      with the time the machine (512 MO) become slow.
      Is there a way to release the memory when closing the form.
      Thanks
      >

      Comment

      • Michel Posseth  [MCP]

        #4
        Re: Memory release after form close

        Are you sure one of the components or variabels of your form are used
        outside the form ?
        have you implemented the using stament with your form ?


        You can always force a GC and retrim the proces working setsize, but if
        your objects are not marked for collection this will only degrade the
        perfomance of your app . see this thread for the code



        If you can`t find the problem another solution could be to use seperate
        application domains as you have the possibility to unload them and this will
        give you the resources back .

        HTH

        Michel



        "touf" <touiss@hotmail .comschreef in bericht
        news:%231LrT2$0 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
        HI,
        In my windows application (VB.NET) when I open a form the memory is
        increasing but When I close it the memory doen't decrease (task manager).
        each time I close the form and re-open it the memory is increasing.
        with the time the machine (512 MO) become slow.
        Is there a way to release the memory when closing the form.
        Thanks
        >

        Comment

        Working...