diff --git a/src/detection/memory/memory_obsd.c b/src/detection/memory/memory_obsd.c index 3dda7656a..e58bf0d37 100644 --- a/src/detection/memory/memory_obsd.c +++ b/src/detection/memory/memory_obsd.c @@ -2,10 +2,7 @@ #include "common/sysctl.h" #include - -#if __NetBSD__ - #include -#endif +#include const char* ffDetectMemory(FFMemoryResult* ram) { @@ -15,7 +12,7 @@ const char* ffDetectMemory(FFMemoryResult* ram) return "sysctl(CTL_VM, VM_UVMEXP) failed"; ram->bytesTotal = (uint64_t) buf.npages * instance.state.platform.sysinfo.pageSize; - ram->bytesUsed = ram->bytesTotal - (uint64_t) buf.free * instance.state.platform.sysinfo.pageSize; + ram->bytesUsed = ((uint64_t) buf.active + (uint64_t) buf.inactive + (uint64_t) buf.wired) * instance.state.platform.sysinfo.pageSize; return NULL; }