| I've been consulting on EKS/GKE cost optimization for a few mid-sized companies and kept seeing the same pattern: massive over-provisioning of memory just to be safe. I wrote a simple CLI tool (bash wrapper around kubectl) to automate diffing kubectl top metrics against the declared requests in the deployment YAML. I ran it across ~500 pods in production. The "waste" (allocated vs. used) average by language was interesting: Python: ~60% waste (Mostly sized for startup spikes, then idles empty). Java: ~48% waste (Devs seem terrified to give the JVM less than 4Gi). Go: ~18% waste. The tool is called Wozz. It runs locally, installs no agents, and just uses your current kubecontext to find the gap between what you pay for (Requests) and what you use (Usage). It's open source. Feedback welcome. (Note: The install is curl | bash for convenience, but the script is readable if you want to audit it first). |
Java will happily eat all the memory you throw at it. The fact that it isn't means they are probably relying on the default JVM settings. Those are too conservative inside a container, especially if they are running on older JVM versions.
What you'll find is the JVM will constantly have "waste" due to it's default configuration. The question is if it ends up throwing out of memory exceptions due to the lower memory limit.
If your devs haven't looked at the heap allocation of a running application, there's no way to know if this is too much or too little memory.
Go/python much more readily give memory back to the OS.