https://www.google.com.ua/search?q=java+recover+out+of+memory&oq=java+recover+out+of+memory https://venishjoe.net/post/recover-from-out-of-memory-errors-in-java/
https://stackoverflow.com/questions/2679330/catching-java-lang-outofmemoryerror
-XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=10 which pretty much means that if after gc, more than 10% of the heap is free, it will try to give the memory back to the OS. and it will grow the heap only if more than 90% of the heap is used after gc.
this might slow down your program, because the gc will be constantly changing allocated memory size. and it is possible that it will have no effect at all if your program allocates large amount of memory in a short period of time.
https://stackify.com/best-practices-exceptions-java/ https://10kloc.wordpress.com/2013/03/09/runtimeexceptions-try-catch-or-not-to-catch/ https://www.javamex.com/tutorials/exceptions/exceptions_uncaught_handler.shtml
https://techblug.wordpress.com/2011/07/16/detecting-low-memory-in-java/
https://plumbr.io/outofmemoryerror/java-heap-space http://www.vogella.com/tutorials/JavaPerformance/article.html
https://jaxenter.com/nobody-puts-java-container-139373.html
https://stackoverflow.com/questions/49854237/is-xxmaxramfraction-1-safe-for-production-in-a-containered-environment
https://stackoverflow.com/questions/24137280/why-doesnt-the-jvm-use-more-heap-memory
https://blog.csanchez.org/2017/05/31/running-a-jvm-in-a-container-without-getting-killed/
https://docs.oracle.com/cd/E19900-01/819-4742/abeik/index.html
https://www.pushtechnology.com/support/kb/understanding-the-java-virtual-machine-heap-for-high-performance-applications/
https://stackoverflow.com/questions/6902135/side-effect-for-increasing-maxpermsize-and-max-heap-size
-XX:MaxRAMPercentage
https://medium.com/@matt_rasband/dockerizing-a-spring-boot-application-6ec9b9b41faf