use the new quick_stat+trim from mirage-xen 8.0.0

This commit is contained in:
palainp 2022-07-27 14:26:58 +02:00
parent 7718c95f20
commit 68ab4f37c1
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ let main =
package "mirage-qubes" ~min:"0.9.1";
package "mirage-nat" ~min:"2.2.1";
package "mirage-logs";
package "mirage-xen" ~min:"7.0.0";
package "mirage-xen" ~min:"8.0.0";
package ~min:"6.1.0" "dns-client";
package "pf-qubes";
]

View File

@ -43,11 +43,12 @@ let init () =
let status () =
let stats = Xen_os.Memory.quick_stat () in
if fraction_free stats > 0.1 then `Ok
if fraction_free stats > 0.4 then `Ok
else (
Gc.full_major ();
Xen_os.Memory.trim ();
let stats = Xen_os.Memory.quick_stat () in
report_mem_usage stats;
if fraction_free stats < 0.1 then `Memory_critical
if fraction_free stats < 0.4 then `Memory_critical
else `Ok
)