How Memory Settings Impact IntelliJ IDEA Performance: A Practical Test
This article reports a systematic experiment that compares four IntelliJ IDEA memory configurations on a MacBook Pro, measuring startup time, project loading speed, and garbage‑collection behavior with jstat, and concludes that allocating more heap (2‑4 GB) significantly improves IDE responsiveness for large codebases.
Goal
The author plans to test different memory settings of IntelliJ IDEA in a realistic development scenario (loading a large monolith project, several micro‑service modules, and refreshing after a git pull) to find the configuration that offers the best balance of memory consumption and speed.
Test Machine and Projects
MacBook Pro Retina, 2.3 GHz Intel Core i7, 16 GB DDR3, SSD, macOS Yosemite
Monolith project: ~700 k lines of Java 8 and Groovy code, 303 Gradle modules
Two micro‑service projects: each ~10‑20 k lines of Java 8 and Groovy, one Gradle module each
Test Scenario
Close all projects in IDEA
Apply a specific idea.vmoptions file
Reboot the computer
Close unrelated projects after IDE launch
Measure IDEA startup time
Open the large monolith project and record time
Run jstat -gcutil Open the two micro‑service projects and record time
Run jstat -gcutil Return to the monolith project, click “Refresh Gradle” and record time
Run
jstat -gcutiljstat -gcutil
-gcutilprovides a summary of garbage‑collection statistics, including survivor space, Eden, old generation, metaspace utilization, and counts/times of young and full GC events.
S0 S1 E O M CCS YGC YGCT FGC FGCT GCT
89.70 0.00 81.26 74.27 95.68 91.76 40 2.444 14 0.715 3.159The most important metrics for this article are the number of GC events (YGC, FGC) and their collection times (YGCT, FGCT).
Test Settings
Four configurations were defined:
Default (gray)
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOopsBig (red)
-Xms1024m
-Xmx4096m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOopsBalanced (blue)
-Xms2g
-Xmx2g
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOopsSophisticated (orange)
-server
-Xms2g
-Xmx2g
-XX:NewRatio=3
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:ReservedCodeCacheSize=240m
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
-XX:SoftRefLRUPolicyMSPerMB=50
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-eaThe idea.vmoptions file was placed in ~/Library/Preferences/IntelliJIdea15/ (or the equivalent path on other OSes).
Results
IDEA Startup Time
Startup time was consistently around 10 seconds for all configurations, indicating that early‑stage IDE launch is not affected by memory settings.
Loading the Large Project
The default configuration took roughly three times longer than the custom settings. GC activity was much higher under the default setting, causing long Full GC pauses.
Full GC time was up to 50 times longer with the default memory, making the IDE sluggish.
Opening Two Micro‑service Projects
The sophisticated setting performed best, while the default lagged behind.
Reloading the Monolith After Refresh
The default (gray) bar was extremely high because IDEA crashed during the refresh, confirming insufficient memory.
Among the custom configurations, the “Big” setting yielded the shortest reload time, showing that larger heap improves responsiveness.
Conclusion
The experiment demonstrates that even modest adjustments to IntelliJ IDEA’s JVM memory options can dramatically improve performance, especially for large codebases. Allocating 2 GB–3 GB of heap generally offers the best trade‑off between speed and memory consumption, though the exact optimum may vary per project.
Discussion
Readers are invited to share their own idea.vmoptions configurations and any additional techniques for boosting IntelliJ IDEA performance.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
