private static long GetTotalMemory()
{
using (var reader = new RandomAccessFile("/proc/meminfo", "r"))
{
var line = reader.ReadLine();
var split = line.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
return Convert.ToInt64(split[1])*1024;
}
}