ZennoLab Assemblies Documentation
MinimizeMemory Method
Example 
ZennoLab.CommandCenter Namespace > Instance Class : MinimizeMemory Method
Performs a forced garbage collection. May cause the application hangs. ATTENTION! When using MinimizeMemory deletes all references to elements and documents, and thus need to re-obtain elements and documents.
Syntax
public void MinimizeMemory()
Example
The following code example demonstrates uses of the MinimizeMemory method.
instance.ActiveTab.Navigate("yandex.ru");
instance.ActiveTab.WaitDownloading();
            
// get html element and set value
var he = instance.ActiveTab.FindElementById("text");
he.SetValue("123", "Full", false);
project.SendInfoToLog(he.ErrorDetected.ToString(), ""); // result "False"
            
// minimize memory and release references
instance.MinimizeMemory();
            
// try set value by old reference, but nothing change, because reference was released
he.SetValue("345", "Full", false);
project.SendInfoToLog(he.ErrorDetected.ToString(), ""); // result "True"
            
// get html element again and successfully set new value
he = instance.ActiveTab.FindElementById("text");
he.SetValue("345", "Full", false);
project.SendInfoToLog(he.ErrorDetected.ToString(), ""); // result "False"
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Instance Class
Instance Members