We are running a Java 8 application with a JNI layer which has crashed due to an Out of Memory Error
somewhere in the C layer.
Along with the usual hs_err_pid.log file, we have noticed this time that we've also received a replay_pid.log file. I've done some extensive Google-foo and can barely find anything about this file.
Has anyone seen this file before, and does anyone know what it contains and how best to analyse it?
The file is generated by the java hotspot to gives replay information about the operations at the time of the issue occurring. Whether or not it gives you anything specific enough to tell you where the issue is seems to be hit or miss, but it does help tell you what was going on in general at the time.
There was a similar issue reported under OpenJDK about the replay file being generated after a segmentation fault occurred. The issue was said to be fixed with a later build, so if you are using a version less than 8u40, I would upgrade and see if that fixes the issue. (issue as reported)
If not, then you will have to start digging through your C/C++ files, figuring out what is causing the seg fault. Since you are using JNI, one thing to remember (and pardon me if you're aware) is that if you make a call in Java through JNI to C/C++ and then in that call, allocate any memory, that memory allocation is not freed up when your Java object is garbage collected. You have to manually free up the allocated memory. If a function makes numerous calls to the same C/C++ class and each time it allocates more memory, then eventually you will end up with this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With