From 5adf4aabcfff52fdaede29b735da8854fc258007 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 3 Jun 2020 23:30:16 +0000 Subject: [PATCH] --- devdocs/todo.txt | 4 +--- .../AyaNova/Controllers/ServerMetricsController.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 76b60ddf..f90fcd7d 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -41,9 +41,7 @@ todo: add backup master time out setting TODO: BIG UPDATE ALL GUTS -todo: do I have a memory leak or something? - I'm seeing gc not collecting beyond a certain point and possibly rising over time gen0 - https://docs.microsoft.com/en-us/aspnet/core/performance/memory?view=aspnetcore-3.1 + todo: notification? diff --git a/server/AyaNova/Controllers/ServerMetricsController.cs b/server/AyaNova/Controllers/ServerMetricsController.cs index 4922b88f..ba2cba0c 100644 --- a/server/AyaNova/Controllers/ServerMetricsController.cs +++ b/server/AyaNova/Controllers/ServerMetricsController.cs @@ -49,9 +49,17 @@ namespace AyaNova.Api.Controllers serverState = apiServerState; } +#if (DEBUG) + [HttpGet("collect")] + public ActionResult GetCollect() + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); - - + return Ok(); + } +#endif /// /// Get Memory and CPU server metrics for time period specified