gpt4 book ai didi

asp.net - web.config 中的 debug=true = 坏事?

转载 作者:行者123 更新时间:2023-12-03 05:59:24 25 4
gpt4 key购买 nike

我们看到大量虚拟内存碎片和内存不足错误,然后达到了 3GB 限制。

编译调试在 web.config 中设置为 true,但我从每个人那里得到了不同的答案,调试设置为 true 是否会导致每个 aspx 编译到 ram 的随机区域,从而使 ram 碎片化并最终导致内存不足有问题吗?

最佳答案

Scott Guthrie(ASP.NET 开发团队的经理)有一个 interesting post about it .

为什么你不应该离开的最重要的几点debug="true"是:

  1. The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)
  2. Code can execute slower (since some additional debug paths are enabled)
  3. Much more memory is used within the application at runtime
  4. Scripts and images downloaded from the WebResources.axd handler are not cached by the browser, resulting in more requests between client and server

他还提到了旗帜 <deployment retail=”true”/ > 在 machine.config 中,它允许全局覆盖在计算机上(例如在生产服务器上)运行的所有应用程序的 debug="true"标志。

<小时/>

更新:使用 debug="true" 部署 Web 应用程序仍然很糟糕,正如您可以在 Scott Hanselman's recent blog post 中读到的那样:

Here's why debug="true" is bad. Seriously, we're not kidding.

  • Overrides request execution timeout making it effectively infinite
  • Disables both page and JIT compiler optimizations
  • In 1.1, leads to excessive memory usage by the CLR for debug information tracking
  • In 1.1, turns off batch compilation of dynamic pages, leading to 1 assembly per page.
  • For VB.NET code, leads to excessive usage of WeakReferences (used for edit and continue support).

An important note: Contrary to what is sometimes believed, setting retail="true" in a element is not a direct antidote to having debug="true"!

关于asp.net - web.config 中的 debug=true = 坏事?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/621572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com