相关疑难解决方法(0)

Application_End应该在自动App Pool Recycle上启动吗?

我看了这个,这个,这个这个加上一打其他职位/博客.

我在共享主机中有一个ASP.Net应用程序,经常回收.我们使用NLog并在global.asax中包含以下代码

void Application_Start(object sender, EventArgs e) 
{
    NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
    logger.Debug("\r\n\r\nAPPLICATION STARTING\r\n\r\n");
}
protected void Application_OnEnd(Object sender, EventArgs e)
{
    NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
    logger.Debug("\r\n\r\nAPPLICATION_OnEnd\r\n\r\n");
}

void Application_End(object sender, EventArgs e) 
{
        HttpRuntime runtime = (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic  | BindingFlags.Static  | BindingFlags.GetField,  null,  null,  null);

if (runtime == null)
    return;

string shutDownMessage = (string)runtime.GetType().InvokeMember("_shutDownMessage",  BindingFlags.NonPublic  | BindingFlags.Instance  | BindingFlags.GetField,  null,  runtime,  null);

string shutDownStack = (string)runtime.GetType().InvokeMember("_shutDownStack",   BindingFlags.NonPublic  | BindingFlags.Instance  | BindingFlags.GetField, …
Run Code Online (Sandbox Code Playgroud)

asp.net iis memory-management

8
推荐指数
1
解决办法
5608
查看次数

从应用程序内监视ASP.NET应用程序内存

我正在寻找应用程序本身监视其使用的内存量的方法,因此我可以每小时左右将其记录在日志文件中,并密切关注应用程序的使用情况.

它全部托管,因此我们可以对系统进行更改以查看正在发生的事情,因此解决方案必须来自应用程序代码.

我们将来可能会使用内存信息来影响缓存策略.

memory asp.net

6
推荐指数
1
解决办法
2177
查看次数

标签 统计

asp.net ×2

iis ×1

memory ×1

memory-management ×1