我们有内存泄漏问题。当使用Eclipse Memory分析器分析堆转储(使用应用程序6个小时)时,我们具有以下堆栈:
#Problem suspect 1
170 000 instances of "org.eclipse.persistence.oxm.XMLDescriptor", loaded by "sun.misc.Launcher$AppClassLoader @ 0x6c000d440" occupy 708 287 296 (30,02 %) bytes. These instances are referenced from one instance of "java.util.concurrent.ConcurrentHashMap$Node[]", loaded by "<system class loader>".
#Keywords of the issue: java.util.concurrent.ConcurrentHashMap$Node[]
org.eclipse.persistence.oxm.XMLDescriptor
sun.misc.Launcher$AppClassLoader @ 0x6c000d440
这是您的问题的解决方案:
public void _old_execute(BatchTaskChunk块,int nrRetriesToPerform)引发BatchRecoverableException,BatchUnrecoverableException {NPBatchTaskChunk signalChunk =(NPBatchTaskChunk)块;
Signal signal = null;
try {
signal = getSignalMgr().findById(signalChunk.getSignalId());
String result = processSignal(signal, processor);
signal.setResult(result);
getSignalMgr().archive(signal);
} catch (NPBatchSignalRejectException e) {
// log reject msg
String msg = e.getMessage();
if (msg.length() > 254) {
msg = msg.substring(0, 254);
}
signal.setResult(msg);
try {
getSignalMgr().archive(signal);
} catch (ServiceException inner) {
throw new BatchUnrecoverableExceptionImpl(chunk, "Unable to treat signal #" + signalChunk.getSignalId(), inner);//NOPMD
}
} catch (Exception e) {
throw new BatchUnrecoverableExceptionImpl(chunk, "Unable to treat signal #" + signalChunk.getSignalId(), e);
}
}