Hi all,
we're facing a similar problem in our production environment. First we try to replicate the problem in a
test environment, a clone of the production environment, with little success. Fortunately we've discovered this forum thread and the kill -3 option.
We toke a threaddump of the production server, while 3 of the 4 cpu's shows a 100% occupation, and found two methods being accessed from several threads and all them are in runnable state. This two methods have loops, I've pasted two code snippets at the bottom of this post.
If you could have a look at the
threaddump and confirm us we are in the right way we will appreciate your help a lot.
Thanks in advance
public void service(HttpServletRequest request, HttpServletResponse response){
try {
...
response.setContentType ("application/download");
response.setHeader ("Content-Disposition", "attachment; filename="+nombreFichero );
java.io.File file = new java.io.File(nombreFichero);
response.setContentLength((int)file.length());
java.io.InputStream in = new java.io.BufferedInputStream (new java.io.FileInputStream(file) );
int length;
byte[] buf = new byte[response.getBufferSize()];
java.io.OutputStream op = response.getOutputStream ();
while ((in != null) && ((length = in.read(buf)) != -1)){
op.write(buf,0,length);
}
if (in != null){
in.close();
}
if ( op != null){
op.close();
}
}catch (Exception e){
...
}
}
private ApplicationObjectInterface buscarFamiliaEnJerarquia(
String id) throws Exception{
if(nivelesJerarquia != null){
ApplicationObjectInterface obj = null;
for( Iterator iter= this.nivelesJerarquia.values().iterator();iter.hasNext() ; ) {
obj = (ApplicationObjectInterface) iter.next();
if ( obj != null && obj.getObjetosHijos() != null){
HashMap gamasCat = obj.getObjetosHijos();
for (Iterator iter1=gamasCat.values().iterator(); iter1.hasNext() ; ) {
obj = (ApplicationObjectInterface) iter1.next();
if ( obj != null && obj.getObjetosHijos() != null){
HashMap familiasCat = obj.getObjetosHijos();
for (Iterator iter2=familiasCat.values().iterator(); iter2.hasNext() ; ) {
obj = (ApplicationObjectInterface) iter2.next();
if ( obj != null && obj.getId().equals(id)){
return (ApplicationObjectInterface) obj;
}//if
}//for
}//if
}//for
}//for
}//for
}//if
return null;
}
[ July 16, 2008: Message edited by: Marco Fern�ndez ]
[ July 16, 2008: Message edited by: Marco Fern�ndez ]
[ July 18, 2008: Message edited by: M Fern�ndez ]
[ July 18, 2008: Message edited by: M Fern�ndez ]