Merging changes
This commit is contained in:
1 parent
c4216d2272
commit
797816be7e
437 files changed
+54228
-28
No files matched your search
@@ -1,3 +1,52 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Linq;
|
||||
|
||||
Console.WriteLine("Starting PubSubServer...");
|
||||
//using BCG.Utilities;
|
||||
//using BCG.Utilities.General;
|
||||
|
||||
|
||||
namespace BCG
|
||||
{
|
||||
class PubSub2Main
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (args.Length > 0 && args[0] == "daemon")
|
||||
args = args.Skip(1).ToArray();
|
||||
|
||||
//CoreServicesInit.init();
|
||||
PubSub3Config config = PubSub3Config.instance;
|
||||
|
||||
long currentMemory = 0;
|
||||
int defaultWaitTime = 100;
|
||||
bool gced = false;
|
||||
new Thread(() =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
gced = false;
|
||||
currentMemory = GC.GetTotalMemory(false);
|
||||
if (config.PS3_GCActivationThreshold > 0 && currentMemory > config.PS3_GCActivationThreshold)
|
||||
{
|
||||
string gcMsg = String.Format("GCing memory, mem before GC = {0}", currentMemory);
|
||||
// BlueEventLog.logEvent(gcMsg, PS3LogLevels.info);
|
||||
Console.WriteLine(gcMsg);
|
||||
GC.Collect();
|
||||
gced = true;
|
||||
}
|
||||
Thread.Sleep(gced ? config.PS3_WaitPeriodAfterGC : defaultWaitTime);
|
||||
}
|
||||
}).Start();
|
||||
|
||||
PubSubMessageReactor pubSubServer = new PubSubMessageReactor();
|
||||
pubSubServer.start();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user