Does anyone have code to clear memory?
My program dies after a while of usage, i need to clear the memory after each process.... hrm...
Printable View
Does anyone have code to clear memory?
My program dies after a while of usage, i need to clear the memory after each process.... hrm...
Well ways to reduce memory usage first off would be usinginstead ofCode:VbNullString
That is only when it is possible to use either.Code:= ""
I am not to certain as to how to clear the ram, exactly. But apparently there are some programs that use up as much ram as possible then clear it. There might possibly be an open source example some where my friend made one but he made a while back and doesn't have the source no more.
is there any way to restart a control without restarting the entire program? Like, restart webbrowser1 for example? Without killing the exe?
I forget the exact functioning behind the refresh command but that should work. ExampleMSDN will tell you more :)Code:Text1.Refresh
It should just basically reload the UI(User Interface).
I wonder if instead of doing the following for every control
If doing just...Code:controlname.Refresh
will do the same thing? I believe it should :)Code:Me.Refresh
Is there any way to restart a control without restarting the entire program? Like, restart webbrowser1 for example? Without killing the exe?
Sorry for misleading you. But when i say reload i mean refresh but it doesn't close. Everything stays the same it just 'refreshes' it self :)
We would have to see your code otherwise we will just make general suggestion like set your controls = nothing after usage. Most likely you create new objects and do not release them then create new objects.
Could be a number of things though...
If possible I would like a way to "reset" or "restart" the webbrowser control....
You will need to post your project or code to say the least...
Anyone else?
Well, you could at least post some of your codes so that we can pinpoint the problem.
I can give you tips but this will not help much to the actual problems you're encountering.
Some tips i know...
Set it to New when instantiating objects. Instead of doing this
do it like thisCode:Dim aVariable As New Class.Description
The general idea is to make sure all processes are properly disposed or terminated before exiting the program. Setting objects to nothing, unloading, etc etc.Code:Dim aVariable As Class.Description
'will create a new instance
Set aVariable = New Class.Description
'Remove from memory
Set aVariable = Nothing
It's webbrowser control.
All events are triggered by the documentcomplete function. It loops...
That's why it takes a lot of memory.
The problem lies with webbrowser1...
I would just like to clear the memory in general, is there any sample code around here?
You really don't understand how this works...
In Task Manager is your program using insane amounts of memory or what? Does it go up over time or stay the same?
@erbio
You can't do anything about it. If you want to control the amount of memory usage then you create your own webbrowser and never rely on Iexplorer component control. Search on how to parse html if you have the guts to go nuts.
Without seeing your code this is non-productive...
He might be refering to the stack... if so erbio then you'll have to come up with another scheme (such as a queue?) for your procedure calls to keep them from exhausting the stack.