/// <summary> /// Performs a garbage collection using the specified generation in both this and the application being automated /// </summary> /// <param name="generation"></param> public static void GarbageCollect(int generation) { m_APE.AddFirstMessageGarbageCollect(generation); m_APE.SendMessages(EventSet.APE); m_APE.WaitForMessages(EventSet.APE); GC.Collect(); GC.WaitForPendingFinalizers(); }
private void buttonGCFull_Click(object sender, EventArgs e) { m_APE.AddFirstMessageGarbageCollect(System.GC.MaxGeneration); m_APE.SendMessages(EventSet.APE); m_APE.WaitForMessages(EventSet.APE); }