healthcheck: report real amount of memory allocated by beam
authorrinpatch <rinpatch@sdf.org>
Fri, 8 May 2020 20:51:59 +0000 (23:51 +0300)
committerrinpatch <rinpatch@sdf.org>
Fri, 8 May 2020 20:57:47 +0000 (23:57 +0300)
as opposed to memory currently in use

CHANGELOG.md
lib/pleroma/healthcheck.ex

index 270c1b8693cdcc3d97a094c885809c31ec911368..d469793f0efd114ea64463748e44903ad4b8c898 100644 (file)
@@ -42,6 +42,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
 ## [Unreleased (patch)]
 
+### Fixed
+- Healthcheck reporting the number of memory currently used, rather than allocated in total
+
 ## [2.0.3] - 2020-05-02
 
 ### Security
index 8f7f43ec24d0e2e93fc5c4dbf6f61b241bf45465..92ce83cb7ba6669397b467d01799aaa0bb72e257 100644 (file)
@@ -29,7 +29,7 @@ defmodule Pleroma.Healthcheck do
   @spec system_info() :: t()
   def system_info do
     %Healthcheck{
-      memory_used: Float.round(:erlang.memory(:total) / 1024 / 1024, 2)
+      memory_used: Float.round(:recon_alloc.memory(:allocated) / 1024 / 1024, 2)
     }
     |> assign_db_info()
     |> assign_job_queue_stats()