AMD EPYC13 min read•Updated November 2026

AMD EPYC VPS for Java Applications

Quick answer

For Java on an AMD EPYC VPS, use a current LTS JDK (for example 21) from a maintained distribution, size the heap explicitly or with -XX:MaxRAMPercentage so heap plus native memory fits the service's memory budget, keep the default G1 collector for most services (consider ZGC for large heaps that need very short pauses), size thread and connection pools to vCores and the database, and monitor with Java Flight Recorder and JVM metrics. Run the application under systemd behind Nginx, and give the database its own memory budget.

The JVM is fast, mature and well instrumented, but it treats memory differently from most runtimes: it reserves a heap, uses additional native memory for threads, metaspace and buffers, and tunes itself based on what it detects about the machine. On a VPS, where memory is shared with a database and the OS, getting those numbers right is the main job. This guide covers that, plus collectors, pools and monitoring. Deployment steps are in our Spring Boot guide.

Choose a JDK

Use a long-term-support release (Java 17, 21 or newer LTS) from a maintained distribution such as Eclipse Temurin, Amazon Corretto or your Linux distribution's OpenJDK packages. Newer JDKs bring faster startup, better garbage collectors and container awareness. Pin the version and update it for security releases, which come quarterly.

Memory: Heap and Everything Else

AreaWhat uses itControlled by
HeapYour objects-Xmx / -XX:MaxRAMPercentage
MetaspaceClass metadata-XX:MaxMetaspaceSize (optional cap)
Thread stacksEach thread, often ~1 MB reserved-Xss, thread pool sizes
Direct buffersNetty, NIO-XX:MaxDirectMemorySize
Code cache, GC structuresJIT-compiled code, collector bookkeepingMostly automatic

The process uses noticeably more than -Xmx. A practical rule: give the heap about 60–75% of the memory budget for the service, and leave the rest for native memory. On a dedicated 8 GB server that also runs PostgreSQL, a 2–3 GB heap for one service is a reasonable start.

# systemd unit
Environment="JAVA_TOOL_OPTIONS=-Xms1g -Xmx3g -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/tmp"
MemoryMax=4500M

Without explicit settings, the JVM's default maximum heap is a quarter of the memory it detects, which can be too small on a dedicated server and too large when several JVMs share one. In containers, -XX:MaxRAMPercentage=70 sizes the heap relative to the container's limit. ExitOnOutOfMemoryError lets systemd restart a broken process cleanly instead of leaving it half-working.

Choosing a Garbage Collector

CollectorStrengthUse when
G1 (default)Balanced throughput and pausesMost services with heaps from hundreds of MB to tens of GB
ZGC (generational in recent JDKs)Very short pauses, scales to large heapsLatency-sensitive services, large heaps
ParallelHighest throughput, longer pausesBatch jobs where pauses do not matter
SerialMinimal overheadTiny services with very small heaps

Start with G1 and measure pause times in GC logs (-Xlog:gc*:file=/var/log/app/gc.log:time,uptime:filecount=5,filesize=20m). Switch only when data shows pauses are a problem.

Threads and Pools

  • Web server threads (Tomcat, Jetty): defaults of around 200 threads suit blocking I/O; reduce them on small servers to save memory and protect the database.
  • Virtual threads (Java 21+): enable them in frameworks that support them (Spring Boot 3.2+: spring.threads.virtual.enabled=true) to handle many concurrent blocking requests with little memory. The database pool remains the real limit.
  • Connection pool (HikariCP): size from what the database can serve, often 10–30, not from the number of threads.
  • CPU-bound executors: about one thread per vCore.

Startup Time

JVM applications can take seconds to start and warm up the JIT. That matters for deploys and restarts. Mitigations: Class Data Sharing archives (-XX:SharedArchiveFile, or Spring Boot's CDS support), lazy initialisation where safe, and zero-downtime deploys that start the new instance before stopping the old one (see our zero-downtime guide). GraalVM native images start in milliseconds but trade peak throughput and some library compatibility.

Monitoring with JFR and Metrics

# record 2 minutes of production profiling with low overhead
jcmd $(pgrep -f app.jar) JFR.start duration=120s filename=/var/tmp/app.jfr
# quick checks
jcmd $(pgrep -f app.jar) GC.heap_info
jcmd $(pgrep -f app.jar) Thread.print | head -50

Java Flight Recorder has low overhead and is designed for production; open recordings in JDK Mission Control. Expose JVM metrics (heap, GC pauses, threads) through Micrometer and Prometheus, and alert on heap usage after GC trending upwards, which indicates a leak.

CPU and the JIT

The JIT compiler uses CPU during warm-up and benefits from more than one vCore. The JVM detects available processors and sizes GC and JIT threads accordingly; on a 2-vCore plan, GC and compilation compete with request handling during startup, which is normal and settles after warm-up.

Security and Updates

Apply quarterly JDK security updates, keep frameworks and libraries current (dependency checkers in the build flag known vulnerabilities), run the service as an unprivileged user, keep actuator or management endpoints on localhost or behind authentication, and never expose JMX remotely without authentication and TLS.

Sizing

SetupEPYC plan
One Spring Boot service + PostgreSQL2 vCores / 8 GB
Two or three services, Redis and a database4 vCores / 16 GB
Large heaps, Kafka/Elasticsearch, many services8–16 vCores, 32–64 GB

Deploying JVM Services

Package the application as an executable JAR (or a container image), deploy it into a release directory, and restart the systemd service. Because JVMs take a few seconds to start and longer to warm up, run two instances behind Nginx and restart them one at a time for zero-downtime deploys, and configure a readiness check so traffic only reaches an instance once it is ready (Spring Boot exposes readiness and liveness health groups for this).

Common Mistakes

  • No explicit heap size, so the JVM picks a default that is too small or too large for the server.
  • Setting -Xmx to nearly all the RAM, leaving nothing for native memory, the OS or the database.
  • Huge thread pools and connection pools that overwhelm the database.
  • Running an outdated JDK that no longer receives security updates.

Next Steps

Set the heap and collector explicitly, enable GC logging and metrics, and load test before launch; then adjust with real data.

In Short

Budget memory for heap and native use, keep G1 unless data says otherwise, and size pools to the database.

SkyRainCloud Plans for This Workload

JVM applications reserve memory up front: a Spring Boot service with a database is comfortable on 2 vCores / 8 GB; several services or large heaps fit better on 4–8 vCores with 16–32 GB. Leave room outside the heap for native memory, the OS and the database.

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — AMD28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthWebsites, small APIs, bots, staging and VPN serversOrder
VPS 2 — AMD416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,299/monthWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
VPS 3 — AMD832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,499/monthProduction databases, high-traffic sites, multi-container appsOrder
VPS 4 — AMD1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,899/monthLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Frequently Asked Questions

Which Java version should I run in production?
A current LTS release such as Java 21 from a maintained distribution, updated with the quarterly security releases.
How big should the Java heap be on a VPS?
About 60–75% of the memory budget for that service, leaving room for native memory, the OS and any database on the same server.
Why does my Java process use more memory than -Xmx?
The JVM also uses native memory for metaspace, thread stacks, direct buffers, the code cache and GC structures.
Which garbage collector should I use?
G1, the default, for most services. Consider ZGC for large heaps that need very short pauses, and Parallel for batch throughput.
Do virtual threads help on a VPS?
They let a service handle many blocking requests with little memory. The database connection pool still limits real concurrency.
How do I profile Java in production?
Use Java Flight Recorder through jcmd, which has low overhead, and analyse recordings in JDK Mission Control.
Why is my Spring Boot app slow to start?
JVM startup and JIT warm-up take time. Use CDS archives, lazy initialisation where safe and zero-downtime deploys; native images start fastest.
How large should the HikariCP pool be?
Based on what the database can serve, commonly 10–30 connections, not on the number of request threads.
Should I expose JMX remotely?
Not without authentication and TLS. Prefer JFR and metrics exported through a secured endpoint.
Which EPYC plan suits Java applications?
2 vCores / 8 GB for one service with a database, 4 vCores / 16 GB for several services, and larger tiers for big heaps or JVM-based data systems.
Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning