CloudPilot AI
Documentation
All toolsInteractive example · illustrative values

Java Resource Optimization

Coordinate Heap, Memory Request, and Limit. Then lend CPU to the startup event and reclaim it after readiness and protection windows.

Independent resource controls
Each control adjusts only its own resource value.
1.69 GiB

Request, Heap, and Usage remain unchanged.

1.35 GiB

Limit, Heap, and Usage remain unchanged.

0.61 GiB

Only this control changes Xmx and projected Usage; Request and Limit remain unchanged.

What is being changed?
Request is a scheduling reservation; Limit is the runtime ceiling. Only JVM-aware Heap adjustment creates room for actual Usage to fall.
Heap Xms

0.61 GiB

Heap Xmx

0.73 GiB

Projected Usage

0.93 GiB

Protected non-heap

0.37 GiB

One shared 0–5.25 GiB scale

Limit1.69 GiB

Request1.35 GiB

Usage0.93 GiB

Request capacity released

2.85 GiB

Usage reduction potential

1.72 GiB

Node scheduling headroom

5.65 GiB

Two separate outcomes
Do not add Request savings and Usage reduction. They measure different things; neither directly equals billing savings.
Protect the kitchen. Adjust seating to demand.
Non-heap is protected back-of-house space. Heap is the dining area. This is an analogy, not a savings calculator.
18 guests
Seats retained

24

Empty seats

6

Floor space released

40

Keep the back of house safe
Non-heap is not absolutely fixed. Estimate and protect higher recent or historical demand before reducing the dining area.
Borrow at startup. Return it when done.
CPU follows the startup event; Heap settings stay unchanged.
2 min
Observed CPU

3.1 cores

CPU Request

4 cores

Memory Request

2.40 GiB

Starting
Reclaim occurs at the later of creation + 10 min and Ready + 2 min. Both gates must hold.
Startup CPU
StartEnd4.00 cores

Observed series · dashed line: Request

Startup memory
StartEnd2.40 GiB

Observed series · dashed line: Request

Policy boundaries
Memory Request can be scaled by policy, but Memory Limit stays unchanged. Startup Boost does not change Xms/Xmx and is not restricted to Java.

How it works

Kubernetes sees a container's total memory, but a Java process divides that memory into an adjustable Heap and non-heap that must be protected carefully. Changing only the container-level settings can improve scheduling reservations while leaving an oversized JVM memory plan untouched.

Start with the outermost layer. A generic VPA-like approach can adjust Request and link Limit by policy. CloudPilot AI goes inside the JVM, understands Heap, protects non-heap, and then coordinates the outer container settings.

Do not add these two figures: Request is a scheduling reservation; Usage is the process's actual memory consumption.

First, lowering Request releases scheduling reservation. Second, shrinking Heap creates room for actual Usage to fall.

Limit, Request, and Usage use the same original-limit scale. Request changes only the scheduling reservation; Heap adjustment changes projected Usage. The controls constrain selections to a safe range without rewriting another resource value to preserve containment.

Think of non-heap as the kitchen, storage, and staff corridors. It is not completely fixed, but it is harder to compress and needs safe headroom. Heap is the dining area: Xms is the seating prepared when the restaurant opens, and Xmx is the maximum seating it can make available. Keeping many empty tables for light traffic wastes expensive floor space.

Do not say the kitchen never changes. More precisely, it is harder to adjust, so CloudPilot AI estimates and protects it first. Savings come from reducing dining space that stays empty over time—not from squeezing the kitchen or removing peak-demand headroom.

This analogy explains the control relationship; it is not a savings calculator.

Class loading, framework initialization, JIT compilation, and cache warm-up create a clear CPU peak during startup, while Memory usually changes much less. Static configuration forces a tradeoff: reserve for the startup peak forever, or size for steady state and accept instability during coordinated starts.

This capability is not Java-only, although Java is the clearest example. Startup Boost does not modify Xms/Xmx. It temporarily scales up the steady-state resource recommendation, then reclaims it only after both the minimum Boost duration and minimum Ready duration have elapsed.

Request for the startup peak

Startup has enough resources, but steady state needs only about 0.75 cores, leaving roughly 81% of the reservation idle over time.

Reliable startup, wasteful steady state

Request for steady-state demand

Day-to-day utilization is higher, but startup has a roughly 3-core shortfall. Coordinated rollouts or batches of cold starts are more likely to slow down, fail probes, or restart repeatedly.

Efficient steady state, unreliable startup

Borrow at startup. Return it when done.

Provide enough CPU at startup, then automatically resize in place to steady-state demand—so reliability and resource efficiency are no longer a tradeoff.

Reliable startup and efficient steady state

One-time initialization work is using the temporary CPU allowance.

CloudPilot AI separates two concerns that static configuration mixes together: Java Memory is adjusted to actual demand, while CPU is boosted temporarily for the startup event. Each resource gets the control strategy that fits it.

Optimize the Java process itself, not only the outer reservation

JVM-aware Xms/Xmx recommendations create room for actual memory usage to fall while protecting non-heap headroom.

Borrow CPU for a few minutes, not forever

Temporary startup resources remove the forced choice between fragile cold starts and a permanently oversized Request.

Close the loop from observation to decision, execution, and verification

CloudPilot AI identifies the runtime, observes metrics, creates a decision, applies it, and verifies drift—so teams do not have to follow up on JVM settings manually.

Heap is not physically contained within Request.

Request is a scheduling reservation. Until Limit is reached, actual Usage may be above or below it.

non-heap is not absolutely fixed.

CloudPilot AI estimates it and protects higher recent or historical demand instead of shrinking it blindly.

Usage does not drop immediately or one-for-one.

Smaller Xms/Xmx values create room for the JVM to return memory; the actual curve still depends on GC, JVM version, and traffic.

Startup Boost is not Java-only.

It is an explicit policy capability. Java is a particularly strong fit because startup CPU demand is often high.

Memory Limit is not boosted.

Memory Request can be scaled by policy, but Limit stays unchanged because Kubernetes cannot safely decrease it in place later.

Boost requires enough cluster capacity.

Without schedulable headroom, a larger startup Request may leave the Pod Pending.

Heap is not physically contained within Request.

Request is a scheduling reservation. Until Limit is reached, actual Usage may be above or below it.

non-heap is not absolutely fixed.

CloudPilot AI estimates it and protects higher recent or historical demand instead of shrinking it blindly.

Usage does not drop immediately or one-for-one.

Smaller Xms/Xmx values create room for the JVM to return memory; the actual curve still depends on GC, JVM version, and traffic.

Startup Boost is not Java-only.

It is an explicit policy capability. Java is a particularly strong fit because startup CPU demand is often high.

Memory Limit is not boosted.

Memory Request can be scaled by policy, but Limit stays unchanged because Kubernetes cannot safely decrease it in place later.

Boost requires enough cluster capacity.

Without schedulable headroom, a larger startup Request may leave the Pod Pending.

CloudPilot AI / Interactive tools