Skip to content

Instantly share code, notes, and snippets.

@danielhe4rt
Created January 24, 2026 21:22
Show Gist options
  • Select an option

  • Save danielhe4rt/5130f2197aca948e92e7904379345ab1 to your computer and use it in GitHub Desktop.

Select an option

Save danielhe4rt/5130f2197aca948e92e7904379345ab1 to your computer and use it in GitHub Desktop.
PHPStorm VMOptions Optimization File

Refactor the following JVM configuration to fit my hardware.

I will provide:

  • The current JVM config
  • My total RAM (GB)
  • CPU cores/threads
  • Laptop or desktop

Requirements:

  • Scale memory, GC, and JIT settings appropriately
  • Keep it safe and conservative
  • Preserve structure and comments
  • Update comments to match the new hardware
  • Output a ready-to-paste config only (no explanations)

Config:

#your configs here
Ram: 10G
Cores: 32
...
# add anything you think is useful
# ==================================================
# Memory Settings (64 GB RAM Workstation)
# ==================================================
# Initial heap (fast startup, no early resizing)
-Xms4096m
# Max heap (safe upper bound for IDEs on 64 GB RAM)
-Xmx12288m
# Code cache for JIT (plugins-heavy setup)
-XX:ReservedCodeCacheSize=512m
# Metaspace (many plugins, Kotlin, indexing)
-XX:MaxMetaspaceSize=1024m
# Young/Old generation balance (IDE-friendly)
-XX:NewRatio=2
-XX:NewSize=2048m
-XX:MaxNewSize=4096m
# ==================================================
# JIT Compiler (Ryzen 9 7950X – 32 Threads)
# ==================================================
# Server VM for long-running performance
-server
# Compiler threads (≈ 1/4 of logical cores)
-XX:CICompilerCount=12
# Tiered compilation for fast warm-up + peak perf
-XX:+TieredCompilation
# ==================================================
# Garbage Collection (High-Core CPU)
# ==================================================
# Parallel GC works extremely well for IDE workloads
-XX:+UseParallelGC
# GC threads scaled for 16C/32T CPU
-XX:ParallelGCThreads=16
# Pre-touch memory to avoid runtime stalls
-XX:+AlwaysPreTouch
# Reduce duplicate string memory
-XX:+UseStringDeduplication
# Enable escape analysis (stack allocation)
-XX:+DoEscapeAnalysis
# ==================================================
# Soft References (IDE Cache Retention)
# ==================================================
# Very aggressive cache retention (safe with 64 GB RAM)
-XX:SoftRefLRUPolicyMSPerMB=1000
# ==================================================
# JVM Behavior & Stability
# ==================================================
# Faster startup (safe for IDEs)
-Xverify:none
# Thread stack size (plugin-safe)
-Xss2m
# Memory optimizations
-XX:+UseCompressedOops
-XX:+UseCompressedClassPointers
# Avoid massive heap dumps
-XX:-HeapDumpOnOutOfMemoryError
# Network compatibility
-Djava.net.preferIPv4Stack=true
# ==================================================
# Encoding
# ==================================================
-Dfile.encoding=UTF-8
# ==================================================
# JetBrains Toolbox Integration
# ==================================================
# -Dide.managed.by.toolbox=/opt/jetbrains-toolbox/jetbrains-toolbox
# -Dtoolbox.notification.token=c80a9a55-579c-4965-a1fc-123
# -Dtoolbox.notification.portFile=/home/danielhe4rt/.cache/JetBrains/Toolbox/ports/3d9eb422-557d-4da1-aebd-e16bbffaa46a.port
# ==================================================
# Wayland (Linux)
# ==================================================
# -Dawt.toolkit.name=WLToolkit
# -Djava.awt.headless=false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment