-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
I'm using pterodactyl panel on linux to run my servers and noticed that server metrics reports the total memory usage to be 0.
It seems like Rust's native dll returns the wrong value trough SystemInfoEx.systemMemoryUsed.
One possible way to avoid this issue would be to get the list of processes and sum their memory usage like this.
using System.Diagnostics;
long memoryUsageBytes = 0;
foreach (var process in Process.GetProcesses())
{
memoryUsageBytes += process.WorkingSet64;
}Or just get the memory usage of the current server like this:
using System.Diagnostics;
Process currentProcess = Process.GetCurrentProcess();
long memoryUsageBytes = currentProcess.WorkingSet64;Not sure whether there are any downsides or a better solution, but I think it would be worth it to look into a new way of getting the memory usage on linux systems.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed