Bug 121562 [IDE] Need a way to disable forced GC done by IDEIdleHelper
3.2 M4 Some of our performance tests which drive the event loop and wait until the UI settles down can now be affected by a forced GC performed by the IDEIdleHelper. In order to compare the performance tests with 3.1 we need to disable this in our tests.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEIdleHelper.java
package org.eclipse.ui.internal.ide;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.application.IWorkbenchConfigurer;
/**
 * The idle helper detects when the system is idle in order to perform garbage 
 * collection in a way that minimizes impact on responsiveness of the UI.
 * The algorithm for determining when to perform a garbage collection
 * is as follows:
 * 
 *  - Don't gc if background jobs are running
 *  - Don't gc if the keyboard or mouse have been active within IDLE_INTERVAL
 *  - Don't gc if there has been a GC within the minimum gc interval (system property PROP_GC_INTERVAL)
 *  - After a gc, don't gc again until (duration * GC_DELAY_MULTIPLIER) has elapsed.
 *    For example, if a GC takes 100ms and the multiplier is 60, don't gc for at least five seconds
 *  - Never gc again if any single gc takes longer than system property PROP_GC_MAX
 */
class IDEIdleHelper {