//------------------------------------------------------------------------------ | |
// Copyright (c) 2005, 2006 IBM Corporation and others. | |
package org.eclipse.epf.common.utils; | |
/** | |
* Utility class for profiling | |
* | |
* @author Weiping Lu | |
* @since 1.0 | |
*/ | |
public class ProfilingUtil { | |
public static void fullGC() { | |
Runtime rt = Runtime.getRuntime(); | |
long isFree = rt.freeMemory(); | |
long wasFree; | |
do { | |
wasFree = isFree; | |
rt.runFinalization(); | |
rt.gc(); | |
isFree = rt.freeMemory(); | |
} while (isFree > wasFree); | |
} | |
} |