AvailableVirtualMemory in IIS app and console

I am having trouble getting the real value of AvailableVirtualMemory in IIS and console application as described below:

When I run these commands in my console app:

Console.WriteLine(String.Format("Memoria virtual total: {0}MB", My.Computer.Info.TotalVirtualMemory / 1024 / 1024))
Console.WriteLine(String.Format("Memoria virtual disponible: {0}MB", CDec(My.Computer.Info.AvailableVirtualMemory / 1024 / 1024)))

      

The console shows me the following results:

Memoria virtual total: 8388607.875MB
Memoria virtual: 8388028.16015625MB

But when I run these commands on the .aspx page:

Response.Write(String.Format("Memoria virtual total: {0}MB", My.Computer.Info.TotalVirtualMemory / 1024 / 1024))
Response.Write("<br>")
Response.Write(String.Format("Memoria virtual disponible: {0}MB", CDec(My.Computer.Info.AvailableVirtualMemory / 1024 / 1024)))

      

This page shows the following results:

Memoria virtual total: 4095.875MB
Memoria virtual: 3367.91796875MB

Why is there this difference in these different applications? I am using 64 bit operating system. I have searched the reasons on Google and here but I couldn't find anything ...
Thanks in advance.

+3


source to share


1 answer


The application pool (and maybe IIS Express has) for the site your page is running on is .aspx

probably configured for 32-bit mode, so it returns 4GB and 3.3GB respectively. This is a 32 bit process that he can see.



If you use this page on the Visual Studio Toys Web Server, you will get the same result because it is 32-bit too.

+3


source







All Articles