关于使工作进程循环使用的使用内存量的经验法则? [英] Rule of thumb for amount of usage memory it takes to make a worker process recycle?

查看:80
本文介绍了关于使工作进程循环使用的使用内存量的经验法则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多这样的代码库:

I've got a code base with lots of this:

byte[] contents = FileUtils.FileToByteArray(FileOfGartantuanProportions);

我不控制IIS服务器,因此看不到系统日志或进行检测,只是看到我的请求无法返回(死亡白页),有时还会看到YSOD出现内存不足错误.

I don't control my IIS server, so I can't see the system log or do instrumentation, I just get to see my request fail to return (white page of death) and sometimes YSOD with Out of Memory error.

在IIS5或IIS6杀死工作过程或使工作陷于死角之前,是否有人有什么经验可以判断最多可以加载到内存中的数据?

Does anyone have a rule of thumb for what is the most data you can load up into memory before IIS5 or IIS6 will kill the work process or just keel over and die?

或更妙的是,是否有我做过的API调用,例如:

Or better yet, is there an API call I an make, something like:

  if(!IsEnoughMemoryFor(FileOfGartantuanProportion.Length)) throw new SomeException() ;

在XP Pro工作站上,我可以获取一个ASP.NET页来成功处理内存中的超大字节数组,但是这些结果显然不适用于真正的共享服务器.

On my XP Pro workstation I can get get an ASP.NET page to successfully deal with a very large byte array in memory, but these results obviously weren't applicable to a real shared server.

推荐答案

根据 Tess Ferrandez 在TechEd上的演讲中,当您有大约800MB的专用字节或1.4GB的虚拟字节时,您可以开始在32位服务器上看到内存不足异常.

According to Tess Ferrandez's talk at TechEd, you can start seeing Out Of Memory exceptions on a 32bit server when you have about 800MB in Private Bytes or 1.4GB in Virtual Bytes.

她也有一个很好的帖子,说明了为什么出现在这里:

She also had a good post about why this is here:

A餐厅类比

她提出的其他观点包括考虑要序列化为会话的内容-例如,序列化1MB数据集可能会导致序列化和反序列化数据时服务器上每页使用15-20MB内存.

Other points she made included thinking about what you're serialising into session - for example serialising a 1MB dataset can result in 15-20MB of memory used on the server every page as that data is serialised and de-serialised.

这篇关于关于使工作进程循环使用的使用内存量的经验法则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆