by Sid_Lmao · 2w ago · 0 comments
Serial will be your best choice if your app is constantly using 100% of that core or if you need to minimize the amount of memory overhead.
G1 is a better choice if you can be flexible with your memory and if you have a lot of periods in your app where it's below 100% CPU usage (maybe a lot of IO).
I don't think this is true.
Setting your CPU limit to 1 in Kubernetes does not mean the container sees a single logical processor. It only means the kernel allows it to use 1 core worth of CPU _time_.
If your k8s node is an 8 core node, Java will still see 8 logical processors. It just means you can only use 1/8th of each, or all of one, or some combination in-between.
I've never seen a k8s node running on a single core VM, as most of the cloud providers only use these for their free tier or shared core VM's for the lightest of light workloads.
https://kubernetes.io/docs/tasks/administer-cluster/cpu-mana...
that's incorrect, the jvm has been container aware for nearly a decade (https://bugs.openjdk.org/browse/JDK-8146115)
you are correct about the underlying scheduling. limits don't pin you to a core, you get quotas across all available
https://kubernetes.io/docs/tasks/administer-cluster/cpu-mana...
I have also seen customers wasting resources across Kubernetes because their developers would eventually tune JVMs with lowercase `-xmx` flag, which the JVM ignores, and thus by default, the JVM only sets heap size to 25% by default (for => 512mb of available memory).