CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: memory problem

  1. #1
    Join Date
    May 2000
    Posts
    7

    memory problem

    I took two forms. in form1 i placed two buttons and in form2 i palced webbrowser control. if i click form1-button1 i am showing form2. In form2 load event i am navigating some url in webbrowser control.
    If i click form1-button2 i am unloading the form2. This is what i am doing.
    My problem is , If i run my application initioally it is taking 3mb memory. If i click button1 memory increing up to 20mb(i am navigating some url in form2-webbrowser). If i click form1-button2( means i am unloading form2) memory decresing only one mb that means it is showing 19mb.it's not come down to 3md. If i minimise the form1 and max.. than it is going to 3md.I want to release the momory without minimize the form.


  2. #2
    Join Date
    Apr 2001
    Posts
    95

    Re: memory problem

    Only suggestion I could think of was to make sure you are unloading form2 like this:


    Unload Form2
    set Form2 = nothing




    Otherwise, someone else may know more than me.


  3. #3
    Join Date
    May 2000
    Posts
    7

    Re: memory problem

    i done what you suggested. but it's not releaseing the memory.


  4. #4
    Join Date
    Apr 2001
    Posts
    95

    Re: memory problem

    I could be wrong on the following but I believe it is what happens. As your program uses memory it sets a sort of memory buffer to that amount. Then when the amount of memory your program uses decreases, it becomes a kind of empty pocket. So in your test, if you watch the memory usage as you open other large programs such as multiple instances of VB, IE, and other programs, it should show your program's memory usage decreasing. It is just the way Windows functions. From everything that I have read, the code I posted earlier is the proper way to unload a form. Hope this helps.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured