Repository navigation
Cap JVM active processors at the pod CPU request - #135
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
A high-confidence issue remains in build.sbt: the fixed processor cap can underutilize larger pods and overstate processors in smaller pods because it is not derived from the pod CPU request.
Test suggestions
- Verify the generated startup configuration includes both MaxRAMPercentage=90.0 and ActiveProcessorCount=2.
- Verify the JVM reports two active processors when the image starts.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the generated startup configuration includes both MaxRAMPercentage=90.0 and ActiveProcessorCount=2.
2. Verify the JVM reports two active processors when the image starts.
TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback
| }.value | ||
|
|
||
| Universal / javaOptions ++= Seq("-XX:MaxRAMPercentage=90.0") | ||
| Universal / javaOptions ++= Seq("-XX:MaxRAMPercentage=90.0", "-XX:ActiveProcessorCount=2") |
There was a problem hiding this comment.
🟡 MEDIUM RISK
In pods requesting more than two CPUs, JVM-sized worker pools can underutilize the available CPUs and reduce throughput. Pods requesting fewer CPUs will instead have their processor count overstated. Consider setting this value from each pod's CPU request, with a suitable default for non-Kubernetes deployments.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
PMD pods have a memory limit but no CPU limit (codacy-tools
PMD.scala: request 1500m / 4Gi, limit 4Gi), socgroup cpu.maxreadsmaxand the JVM'savailableProcessors()returns the node's core count. PMD 6.55.0 defaultsPMDConfiguration.threadstoavailableProcessors()and the wrapper never sets it, so on a 16–64 core node PMD starts one analysis thread per core, each with its own copy of the rulesets, plus as many GC and JIT threads. With the heap at 90% of the limit, all of that shares the remaining ~400Mi.-XX:ActiveProcessorCount=2(the 1500m CPU request, rounded up) next to-XX:MaxRAMPercentage=90.0. That caps PMD's default thread count, the ForkJoin common pool, and the GC/JIT thread counts at once.Same fix as codacy/codacy-opengrep#50.
plugins_test)ToolOutOfMemorycount vs before