In task manager now i see that in use 4.7gb of ram out of 6gb.
Im using this class to get my ram:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Management;
namespace ScreenVideoRecorder
{
class GetMemory
{
public static List<UInt32> DisplayTotalRam()
{
List<UInt32> uints = new List<UInt32>();
string Query = "SELECT MaxCapacity FROM Win32_PhysicalMemoryArray";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(Query);
foreach (ManagementObject WniPART in searcher.Get())
{
UInt32 SizeinKB = Convert.ToUInt32(WniPART.Properties["MaxCapacity"].Value);
UInt32 SizeinMB = SizeinKB / 1024;
UInt32 SizeinGB = SizeinMB / 1024;
//Console.WriteLine("Size in KB: {0}, Size in MB: {1}, Size in GB: {2}", SizeinKB, SizeinMB, SizeinGB);
uints.Add(SizeinKB);
uints.Add(SizeinMB);
uints.Add(SizeinGB);
}
return uints;
}
}
}
And for the test in Form1 i did :
List<UInt32> uints = GetMemory.DisplayTotalRam();
I see now using a breakpoint in the units List :
index [0] i see: 33554432
index [1] i see: 32768
index [2] i see: 32
In task manager 4.7/6.0 (78%)
So why im getting 32 ? (3.2gb)