Hello Gallatin 21V,
Welcome to microsoft Q&A,Thankyou for posting your query here.
AKS and Container insights provide a robust infrastructure for monitoring and diagnostics.
To figure out which part of your Java code caused an "out of memory" error, it might be best to use a mix of tools and methods from both Java and Azure Kubernetes services.
This way, you can get a clearer picture of what went wrong.
AKS supports Kubernetes native logging mechanisms that can capture stdout and stderr outputs from containers.
You can use Container Insights to query these logs and troubleshoot issues with your Java applications, If your Java application logs OOM errors or stack traces to these streams, you can have their output captured and queried through Container insights.
Hope this helps you,
If an answer has been helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!