what is the simplest way to restart my application and clear all variables from ram?
thanks.
Printable View
what is the simplest way to restart my application and clear all variables from ram?
thanks.
Start another instance and close the first one
how?
do you have some code?
.....Quote:
Originally posted by marvinklein
how?
do you have some code?
System.Process.Start("MyProgram.exe")
me.close()
It may not be the most efficient way (since it loads a copy of the program, then the other closes), but it is the easyest.
Quote:
Originally posted by kasracer
.....
System.Process.Start("MyProgram.exe")
me.close()
It may not be the most efficient way (since it loads a copy of the program, then the other closes), but it is the easyest.
anybody have some ideas on the most efficient way of doing this?
If what you want is only to free up more resources, you can call GC.Collect() function to request the garbage collection to free up all unused resources. This way you can re-gain resources without restarting your application.
Before this ,Quote:
Originally posted by Volvere
If what you want is only to free up more resources, you can call GC.Collect() function to request the garbage collection to free up all unused resources. This way you can re-gain resources without restarting your application.
add all your class level variables in destructors(or Dispose() method and call it when you're done of your obj class) and they will be disposed when that instance of the object is no longer used . This is the most efficient way plus explicitly calling GC .
how do you destruct variables or classes?Quote:
Originally posted by Pirate
add all your class level variables in destructors(or Dispose() method and call it when you're done of your obj class) and they will be disposed when that instance of the object is no longer used . This is the most efficient way plus explicitly calling GC .
i know you can do myform.unload...
but how do you dispose arrays or things like that?
on a different, (maybe related??)
also, there is a standard function in classes New()
i know how to use that.
but what does the function finalize() do?
thanks pirate. that's really helpful.