Пример #1
0
        internal static decimal CHECK_Total_Memory_Useage()
        {
            Int64 phav = System_Info.GetPhysicalAvailableMemoryInMiB();
            Int64 tot  = System_Info.GetTotalMemoryInMiB();

            percentFree               = ((decimal)phav / (decimal)tot) * 100;
            percentOccupied           = 100 - percentFree;
            Available_Physical_Memory = phav;
            Total_Memory              = tot;
            Percent_Free              = percentFree;
            Percent_Used              = percentOccupied;

            if (phav < 0 || tot < 0 || Available_Physical_Memory < 0)
            {
                return(-1);
            }
            return(percentFree);
        }