Hi,
this is my code :
instrumentsInQuestion.forEach(instrument -> arrayI.add(EmaFactory.createOmmArrayEntry().codeState().ascii(instrument.getRootSymbol())));
arrayView.add(EmaFactory.createOmmArrayEntry().intValue(1));
batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, arrayI));
batchView.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, arrayView));
ReqMsg reqMsg = EmaFactory.createReqMsg();
reqMsg.serviceName(serviceName).payload(batchView).interestAfterRefresh(false).initialImage(true);
consumer.registerClient(reqMsg, appClient);
....
i collect the handleids and unregister the instruments from
instrumentsInQuestion.forEach(instrumentInQuestion -> {
try {
CompletableFuture.supplyAsync(() -> {
try {
if (instrumentInQuestion.getHandleId() != null)
consumer.unregister(instrumentInQuestion.getHandleId());
else
log.info("Could not get handlerid for "+instrumentInQuestion.getRootSymbol());
} catch (Exception e) {
e.printStackTrace();
}
return true;
}).get(20, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
log.severe("Error unregistering " + instrumentInQuestion.getRootSymbol());
}
});
i have attached the heat dump, screen shoot.
My question is what am i doing wrong and I have 1.6GB of memory wasted?
Update:
The Elektron API support team has asked the client perform a GC and do heap dump at the end of processing of every batch to see if the memory consumption continues to grow.
They has analysis the head dump files and found that
the numbers of WIRequest objects remain constant at 605 instances in all heap dump files. This evidence indicates that it is an expected behavior, not a memory leak.
Due to an outage of the Thomson Reuters Developer Community email notification system from 2:30 PM CDT on November 29th until 9:00 AM CDT on November 30th we are posting to all questions updated during this timeframe in order to ensure all customers receive all relevant email updates. Please review this question, and its associated answers, in order to ensure you are aware of any possible updates that may have occurred during this outage. We apologize for the delay and any inconvenience this has caused.
Matthew Logterman, J.D.
Sr. Product Manager, Thomson Reuters Developer Community