CollectGarbage is now disabled; leads to better long term memory usage

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1609 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2009-07-17 05:21:08 +00:00
parent 72d38eea0f
commit 2f52a2b24c
+5
View File
@@ -99,6 +99,8 @@ namespace ProcessHacker
public static SharedThreadProvider SharedThreadProvider;
public static SharedThreadProvider SecondarySharedThreadProvider;
public static ProcessHacker.Native.Threading.Waiter SharedWaiter;
private static bool CollectGarbageEnabled = false;
private static object CollectWorkerThreadsLock = new object();
/// <summary>
@@ -746,6 +748,9 @@ namespace ProcessHacker
public static void CollectGarbage()
{
if (!CollectGarbageEnabled)
return;
/* Garbage collections */
GC.Collect();
GC.WaitForPendingFinalizers();