Delete StatsCollection memory context after we are done with stats reporting.

Previously we left the memory context untouched, which overtime leaked memory.
pull/1701/head
Hadi Moshayedi 2017-10-12 18:26:13 -04:00
parent 873fd1e7ff
commit 946659aebe
1 changed files with 1 additions and 0 deletions

View File

@ -328,6 +328,7 @@ CitusMaintenanceDaemonMain(Datum main_arg)
prevStatsCollectionFailed = !CollectBasicUsageStatistics();
MemoryContextSwitchTo(oldContext);
MemoryContextDelete(statsCollectionContext);
prevStatsCollection = currentTime;
}
#endif