简体   繁体   English

ASP MVC项目需要永久加载到IIS中

[英]ASP MVC project takes forever to load in IIS

I have a simple MVC .NET 4.5 project, practically the Visual Studio template, and when I start debugging it takes forever to load (sometimes it times out) and IIS consumes a huge amount of memory. 我有一个简单的MVC .NET 4.5项目,实际上是Visual Studio模板,当我开始调试时,它要花很长时间才能加载(有时会超时),并且IIS占用大量内存。

I have read all the posts about this, memory leaks: it is the template; 我已经阅读了所有关于此的文章,内存泄漏:这是模板; Offline Symbol Loading: did that without effect; 脱机符号加载:这样做没有效果; antivirus: I don't have it; 防病毒软件:我没有它; indexing: removed it; 索引:删除它; firewall: removed it... 防火墙:将其删除...

And still nothing. 还是一无所有。

After a lot of trial and error, I'v discovered that enabling the 32-Bit Application in the advanced settings of my application pool would solve my problem. 经过大量的试验和错误,我发现在应用程序池的高级设置中启用32位应用程序可以解决我的问题。

Can anyone explain this behaviour? 谁能解释这种行为? And how to detect it? 以及如何检测呢? Because it took me 3 days to figure this out and there is no indication that this might be a problem. 因为花了我三天的时间才解决这个问题,但没有迹象表明这可能是个问题。

应用程序池高级设置

That's because the processor is slowing you down. 那是因为处理器使您减速。 On a hardware level the process can receive instructions in 2 different forms, either 32-bit or 64-bit. 在硬件级别,该过程可以接收两种不同形式的指令,即32位或64位。 If running in 64-bit mode it can still use 32-bit instructions; 如果在64位模式下运行,它仍可以使用32位指令。 it's just slower because it needs to check whether the instructions are written in 32-bit or 64-bit. 它只是速度较慢,因为它需要检查指令是用32位还是64位编写的。 What really slows it down is when the program is written in 32-bit and IIS is running in 64 bit mode. 真正减慢速度的是程序是用32位编写的,而IIS是在64位模式下运行的。 IIS will then check every set of instructions it receives for the length of the instruction. 然后,IIS将检查它收到的每组指令的指令长度。 This is because it theoretically could receive a 64-bit instruction at any time (even though we know that the program is written in 32-bit mode). 这是因为理论上它可以在任何时间接收64位指令(即使我们知道该程序是以32位模式编写的)。 Now IIS will do this check for every set of instructions or (for simplicity) every line of code. 现在,IIS将针对每组指令或(为简单起见)每一行代码执行此检查。 You could see how this operation isn't exactly slow in and of itself would, over hundreds lines of code, slow your program down dramatically. 您会看到此操作本身并不会完全慢,在数百行代码中,它会大大降低程序速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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