TotalVirtualMemory does not return the amount of virtual memory on the computer. Rather, it returns the virtual address space available to the program.
This will almost always be 2GB, which is the amount of address space allocated to an operating program by windows (at least by win32). For more information on Virtual Address Space, you can check out "Advanced Windows" by Jeffrey Richter, which goes into far more detail.
To get this information, you can add a reference to System.Management.dll and run this
System.Management.ManagementObject logicalMemory = new
System.Management.ManagementObject("Win32_LogicalMemoryConfiguration.Name=\"LogicalMemoryConfiguration\"");
Console.WriteLine("Total virtual memory: {0}",logicalMemory["TotalVirtualMemory"].ToString());
On my work system, this outputs 2809756.
This object also supports these properties
uint32 AvailableVirtualMemory; //in Kb
string Caption;
string Description;
string Name; //NO LONGER SUPPORTED
string SettingID;
uint32 TotalPageFileSpace; //in Kb
uint32 TotalPhysicalMemory; //in Kb
uint32 TotalVirtualMemory; //in Kb
I hope this helps.