We had a peculiar issue in our production system due to a very silly bug in the client library.
What happened was:
public <T> ResponseEntity<T> executePut(String url, JsonObject payload, Class<T> t) {
String payloadString = payload != null ? payload.toString() : null;
HttpEntity<String> entity = new HttpEntity<>(payloadString, getCommonHeaders());
restTemplate.getMessageConverters()
.add(0, new StringHttpMessageConverter(Charset.forName("UTF-8")));
return restTemplate.exchange(url, HttpMethod.PUT, entity, t);
}
As can be seen in the above method, the client library was taking the autowired(singleton) object and kept on adding the element in the MessageConverters list.
Issue: After a while, the reference to the restTemplate object was giving NPE that too with empty stack trace.
PS: I am pointing out this as probable cause because this is the only code change which happened between two deployments.
Also, should not the large object cause heap out of memory? In our case, that too did not happen and other application flows were working flawlessly.