IIS 8.5 long compilation and high memory peak on first access

asp.net-mvciis-8

I have MVC 5 ASP.NET application which is precompiled on built server. There is no compilable elements in deployment package. This web application when deployed on IIS 7/7.5 is starting within 5 seconds on slow server with small memory. There is no memory peak on first run and web page quickly responding.

However the same application deployed on much newer server with bigger memory size and IIS 8.5 during first start behaves like it would be no compilation. I'm seeing high memory peak on first access up to all free memory, and in rare occasions I'm experiencing OutOfMemoryException.

It looks like IIS 8.5 totally ignores fact that application is already compiled and doing it again. Does anybody know is there is possible to solve this issue or I have to stop using new server and go back to old one.

UPDATE 1
After few more test I think this is related rather to x64 bit architecture. If I setup AppPool on IIS 8.5. to run as 32 bits everything is fast as on IIS 7 computer. I understand why IIS process is taking twice as memory on 32 bits. But do not understand why compilation is 7 (seven) times longer, and compilation memory is 10 times bigger.

Best Answer

According to suggestion from @jeremy-cook

Copying my answer:

After few more test I think this is related rather to x64 bit architecture. If I setup AppPool on IIS 8.5. to run as 32 bits everything is fast as on IIS 7 computer.