aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/sys')
-rw-r--r--src/Java/gtPlusPlus/core/util/sys/SystemUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java b/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
index efcfaf8d04..2788ba688e 100644
--- a/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
@@ -14,6 +14,19 @@ public class SystemUtils {
}
}
+ /**
+ * Try invoke the runtime's Garbage Collector.
+ */
+ public static void invokeGC() {
+ try {
+ Runtime r = Runtime.getRuntime();
+ r.gc();
+ }
+ catch (Throwable t) {
+ //Do nothing.
+ }
+ }
+
public static boolean isWindows() {
return (getOSString().indexOf("win") >= 0);
}