Skip to content

Commit

Permalink
Perform an aggressive GC in GameServer before allowing clients to con…
Browse files Browse the repository at this point in the history
…nect.
  • Loading branch information
alexrp committed Aug 24, 2023
1 parent 4dd40ab commit 2c09d8b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/world/Net/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ void HandleTypedPacket(GameConnectionConduit conduit, GamePacket packet)
listeners.Add(listener);
}

// Loading the data center and zone geometry can allocate a lot of temporary memory, so force an aggressive
// cleanup before allowing clients to connect.
GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive);

foreach (var listener in listeners)
{
listener.Start();
Expand Down

0 comments on commit 2c09d8b

Please sign in to comment.