dlmarion commented on issue #2331: URL: https://github.com/apache/accumulo/issues/2331#issuecomment-956512589
So, two other related thoughts here: 1. There are many flavors of OutOfMemoryError. I imagine that you are trying to handle the case where it's "java heap space" by trying to create a smaller object (From what I read, Java heap space is thrown based on a pre-calculation of the size of the object being allocated and the max heap size, thus the VM didn't really run out of memory). It's not clear to me how you would handle other flavors of OutOfMemoryError: direct memory, metaspace, gc overhead limit exceeded, etc. 2. I don't see how you can effectively handle the "java heap space" OOME when it occurs in another thread. The asynchronous nature of this definitely increases the complexity. A lot of the recommendations for handling OOME's deal with finding memory leaks and/or changing VM parameters. There is also the case where it's not a leak and the application is trying to allocate more memory than it was given, which leads back to changing VM parameters. This is also a good time to remind that there are new VM [options](https://bugs.openjdk.java.net/browse/JDK-8258058) for exiting the VM on OOME, which seem handy, but do [not](https://bugs.openjdk.java.net/browse/JDK-8155004) work when the reason for OOME is the inability to create a new native thread. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
