"Efficiency is about doing less, not more. Efficient software does less of the stuff you don't actually need, getting rid of bloat, pointless spinning, and task repetition, ie doing what you need using fewer resources. Reducing resource requirements is not only more efficient but importantly cheaper too!"
"Memory issues diagnosis techniques include: Monitor Java heap, Metaspace and Compressed Class Space usage over time; Monitor heap after Full GCs - if insufficient heap is available, either Xmx or metaspace needs to be larger or there is a memory leak; OOME from native memory means JVM or JNI/JVMTI cannot allocate from native memory - this needs a reduction in Java heap, metaspace, compressed class space, number of threads, or thread stack sizes to free up native memory for the current process, or native memory profiling."