add another kick to GC after map generation at run time

master
UbitUmarov 2020-01-13 18:46:25 +00:00
parent 62f3892cd7
commit 1899a36105
2 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,7 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Runtime;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Timers; using System.Timers;
@ -6027,6 +6028,12 @@ Environment.Exit(1);
{ {
RegenerateMaptile(); RegenerateMaptile();
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.Default;
// We need to propagate the new image UUID to the grid service // We need to propagate the new image UUID to the grid service
// so that all simulators can retrieve it // so that all simulators can retrieve it
string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));