Ok thanks!
Looking more careful it says that the line response.getOUtputStream() causes
the out of memory
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
BufferedInputStream in = null;
ServletOutputStream op = null;
try {
File file = new File(
getHairlessApplicationSettings().getFileResourcePath() ,
request.getRequestURI().replace( request.getContextPath(), "" ) );
if( file.exists() ){
ServletContext context =
getServletConfig().getServletContext();
String mimetype = context.getMimeType(
file.getAbsolutePath() );
response.setContentType( (mimetype != null) ?
mimetype :
"application/octet-stream" );
response.setHeader("Content-Length",
String.valueOf(file.length()));
int length = 0;
op = response.getOutputStream();
byte[] bbuf = new byte[8192];
in = new BufferedInputStream(new
FileInputStream(file));
if( in != null ){
while((length = in.read(bbuf)) != -1)
{
op.write(bbuf,0,length);
}
response.setStatus( 200 );
}else{
response.setStatus( 404 );
}
}else{
response.setStatus( 404 );
}
} catch (Exception e) {
response.setStatus( 404 );
}finally{
if( in != null ){
try{
in.close();
}catch( Exception e ){
}
}
if( op != null ){
try{
op.flush();
op.close();
}catch( Exception e ){
}
}
}
}
--
View this message in context:
http://www.nabble.com/Tomcat-crashes-out-of-memory-tp19203247p19216068.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]