简体   繁体   中英

memory limit for x64 process in IIS7.5

Windows Web Server 2008 R2 (x64) & .Net Framework 4.5

It is a classic ASP.Net Web Site (Not a web project, code is in App_Code directory and compiled when the site is being launched)

And it depends on many reference DLLs in /Bin directory. For those DLLs I have source code, I compile them targeted as "x64" platform.

And I have some other DLLs without source code (mysql.data.dll / etc), which are compiled as "Any CPU". I modified them in EditBin.exe to ensure the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is indicated in their PE header.

According to this table: http://msdn.microsoft.com/en-us/library/aa366778%28VS.85%29.aspx#memory_limits

x64 process can't use more than 2GB memory unless IMAGE_FILE_LARGE_ADDRESS_AWARE is set.

How can I verify whether it works? Is there any place I can see the memory limitation of running x64 process?

I don't know if you can actually "see the memory limitation" explicitly stated (assuming you don't trust MS's own documentation that you cited) other than getting your hands on and digging into the IIS and/or ASP.NET source code.

That being said, you could try stress testing the site, and monitor memory consumption (via Task Manager or Process Monitor ), to see if it exceeds 2GB. I would recommend tinyget , part of the IIS 6 Resource Kit , which can still be used with IIS 7 .

tinyget -svr:localhost -uri:/<your site> -loop:200 -threads:20

You'll have to play with the loop and thread count to try to push it over 2GB. I would expect to see an System.OutOfMemoryException as you approach about 1.4GB of combined physical and virtual private bytes. You may want to create a stress test function in the site itself, for testing purposes only of course , which will help you reach this limit, by using the exact opposite of good practices. You can read more about what would lead to an System.OutOfMemoryException` here , and then do things they recommend against. For example, add a test method that just concatenates strings in a very large loop.

try procexp, from sysinternals here . This application can monitor .NET specific metrics.

Nevertheless, according to your link, you should be able to address at least 8GB.

Please keep in mind that enforcing the IMAGE_FILE_LARGE_ADDRESS_AWARE is irrelevant in your case. You could have all your components compiled to target "Any CPU", the only flag that is checked is the flag of the executable file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM