public void OptimizeMemory()
{
// Forces garbage collection
GC.Collect();
// Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue
GC.WaitForPendingFinalizers();
// Forces garbage collection one more time to eliminate finalized objects
GC.Collect();
}