/// <summary> /// Retrieves the number of bytes currently allocated. /// </summary> public static long GetTotalMemory(bool forceFullCollection) { //we cannot force, but provide hints if (forceFullCollection) { JSystem.RunFinalization(); JSystem.Gc(); } return(JRuntime.GetRuntime().TotalMemory()); }
/// <summary> /// Force a run of the garbase collector. /// </summary> public static void Collect() { JSystem.Gc(); }