最近做个网站 ,访问量比较大,基本上3天就得需要重启weblogic。
在linux下知道修改打开文件数,windows下怎么解决呢?
在linux下知道修改打开文件数,windows下怎么解决呢?
解决方案 »
- mySql表随机查询
- 求Java正则表达式,匹配html链接
- 非常简单的一个问题
- 关于MD5的问题
- bean 验证的问题
- The method getParametersValues(String) is undefined for the type HttpServletRequest
- Error in /cgi-win/itemview.dll,这个是什么错误啊?不懂了。
- 想根据不同的参数来让JS调用不同的数据
- <%@include file="">路经文题
- 放在session中的参数和放在request中的参数,在效率上有什么区别?
- request.getSession().setAttribute不能传递反斜杠“\"?
- 毕业设计 遇到个问题 求大神啊
下面是代码response.setContentType("text/x-msdownload");
//response.addHeader("Content-Disposition","attachment; filename=\"" + new String(abc.getBytes("GBK"),"utf-8") + "\"");
response.addHeader("Content-Disposition","attachment; filename=\"" + new String(newsName.getBytes(),"ISO-8859-1") + "\"");
java.io.OutputStream os = null;
java.io.FileInputStream fis = null;
try {
os = response.getOutputStream();
fis = new java.io.FileInputStream(aFilePath + temp_name);
byte[] b = new byte[1024];
int j = 0;
while ((j = fis.read(b)) > 0) {
os.write(b, 0, j);
}
os.flush();
} catch (Exception e) {
e.printStackTrace();
}finally{
if(fis!=null){
fis.close();
}
if(os!=null){
os.close();
}
}
简单分析就像楼上他们提到的打开文件后未及时关闭导致超出可承受文件打开数范围
但是要找到哪里未及时关闭凭这点信息无法具体判断,应该存在一些强力的工具可以分析当前文件乃至内存使用状态。
暂且认为是这样,这个限对于xp系统是在c:\windows\system32\config.nthttp://www.beaverlog.com/therapist/dos_support/windows_nt_2000_xp.htm
1. 提高系统文件打开数许可上限(但这可能算是治标不治本的方法,因为仍没有完美杜绝超限的可能性)
2. 当用户打开数将超过使用上限时是不是可以对其加以限制,这里方法很多,比如将其加入排队等候队列或直接提示用户数过多无法下载等。