{"id":1845,"date":"2018-06-15T16:01:22","date_gmt":"2018-06-15T10:31:22","guid":{"rendered":"https:\/\/judepereira.com\/blog\/?p=1845"},"modified":"2018-06-15T16:01:22","modified_gmt":"2018-06-15T10:31:22","slug":"intellij-on-steroids-with-g1-gc","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/intellij-on-steroids-with-g1-gc\/","title":{"rendered":"IntelliJ on steroids with G1 GC"},"content":{"rendered":"<p>Lately, I noticed that IntelliJ started to pause for quite some time during it&#8217;s GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically.<\/p>\n<p>The current version of IntelliJ runs on a bundled version of Java 1.8, who&#8217;s default garbage collector is Parallel GC. While this works for most people, it didn&#8217;t for me.<\/p>\n<p>After a ton of reading up on how GC works, and the fine tuning parameters for G1, I put it to use. Here&#8217;s a copy of my idea.vmoptions file:<\/p>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist90180370\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-idea-vmoptions\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-text  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"idea.vmoptions content, created by judepereira on 10:18AM on June 15, 2018.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"idea.vmoptions\">\n<tr>\n<td id=\"file-idea-vmoptions-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-idea-vmoptions-LC1\" class=\"blob-code blob-code-inner js-file-line\">-Xmx2048m<\/td>\n<\/tr>\n<tr>\n<td id=\"file-idea-vmoptions-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-idea-vmoptions-LC2\" class=\"blob-code blob-code-inner js-file-line\">-Xss256k<\/td>\n<\/tr>\n<tr>\n<td id=\"file-idea-vmoptions-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-idea-vmoptions-LC3\" class=\"blob-code blob-code-inner js-file-line\">-XX:+UseG1GC<\/td>\n<\/tr>\n<tr>\n<td id=\"file-idea-vmoptions-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-idea-vmoptions-LC4\" class=\"blob-code blob-code-inner js-file-line\">-XX:InitiatingHeapOccupancyPercent=65<\/td>\n<\/tr>\n<tr>\n<td id=\"file-idea-vmoptions-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-idea-vmoptions-LC5\" class=\"blob-code blob-code-inner js-file-line\">-XX:G1HeapRegionSize=16m<\/td>\n<\/tr>\n<tr>\n<td id=\"file-idea-vmoptions-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-idea-vmoptions-LC6\" class=\"blob-code blob-code-inner js-file-line\">-XX:MaxGCPauseMillis=100<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/judepereira\/5f4276fea45f2e0237e90ba5e4319f61\/raw\/1996d6091f43fa6a5467a8880cb5b785eb241c29\/idea.vmoptions\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/judepereira\/5f4276fea45f2e0237e90ba5e4319f61#file-idea-vmoptions\" class=\"Link--inTextBlock\"><br \/>\n          idea.vmoptions<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n<p>There was an instant performance boost in the IDE &#8211; it was far more responsive than ever before. The pauses have disappeared, and it&#8217;s super snappy :)<\/p>\n<p><strong>Note:<\/strong> As a general rule of thumb, don&#8217;t increase the maximum memory allocated to the IDE beyond 2 gigabytes &#8211; it&#8217;s just not worth it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lately, I noticed that IntelliJ started to pause for quite some time during it&#8217;s GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who&#8217;s default garbage collector is Parallel GC. While [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[618,619,559,463,621,620],"class_list":["post-1845","post","type-post","status-publish","format-standard","hentry","category-code","tag-g1","tag-gc","tag-intellij","tag-java","tag-java-1-8","tag-java-8"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-tL","jetpack-related-posts":[{"id":1685,"url":"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/","url_meta":{"origin":1845,"position":0},"title":"Compile LESS on the fly for your exploded WAR in IntelliJ","author":"Jude Pereira","date":"February 5, 2016","format":false,"excerpt":"At CleverTap, we've recently started using LESS for dynamic CSS. While it has it's upsides, the biggest downside\u00a0was that most of our developers couldn't use the hot deploy feature for their local deployments. After an hour or so, we came up with a neat solution. \u00a0 There are two parts\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"External Tool configuration for compiling LESS files before deployment","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1824,"url":"https:\/\/judepereira.com\/blog\/java-9s-httpclient-doesnt-allow-custom-http-2-authorization-headers\/","url_meta":{"origin":1845,"position":1},"title":"Java 9&#8217;s HttpClient doesn&#8217;t allow custom HTTP\/2 authorization headers","author":"Jude Pereira","date":"January 23, 2018","format":false,"excerpt":"TL;DR Java 9 HttpClient does not allow custom Authorization header unless you resort to a hack. Read more about my blog post on CleverTap's blog.","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1936,"url":"https:\/\/judepereira.com\/blog\/taming-a-throttled-api-with-dynamic-proxies-in-java\/","url_meta":{"origin":1845,"position":2},"title":"Taming a throttled API with Dynamic Proxies in Java","author":"Jude Pereira","date":"January 20, 2021","format":false,"excerpt":"Recently, at CleverTap, we've begun migrating some of our largest clusters to a new protocol (for starters, think ~115 instances at a time). One of the most fun things I've had my hands on during this migration was the AWS Systems Manager API. When we scaled up our migrations gradually\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1616,"url":"https:\/\/judepereira.com\/blog\/0f-float-min_value-false\/","url_meta":{"origin":1845,"position":3},"title":"0f > Float.MIN_VALUE = false!","author":"Jude Pereira","date":"April 23, 2015","format":false,"excerpt":"Updates: Turns out that this is the expected behaviour from the java doc: A constant holding the smallest positive nonzero value of type float, 2-149. So now, how do I get the smallest negative value that a float can hold? Just came across the most weirdest thing ever in Java\u2026","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1696,"url":"https:\/\/judepereira.com\/blog\/mocking-the-http2-apple-push-notification-gateway-in-go\/","url_meta":{"origin":1845,"position":4},"title":"Mocking the HTTP\/2 Apple push notification gateway in Go","author":"Jude Pereira","date":"February 17, 2016","format":false,"excerpt":"At CleverTap, we had the need to mock the new HTTP\/2 Apple push gateway API. After trying to do this in Java, and then in Python, I succeeded in getting it to work in Go. Go out of all languages! To me, Go has a completely strange syntax, compared to\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1675,"url":"https:\/\/judepereira.com\/blog\/sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6\/","url_meta":{"origin":1845,"position":5},"title":"Sending notifications via Apple&#8217;s new HTTP\/2 API (using Jetty 9.3.6)","author":"Jude Pereira","date":"January 9, 2016","format":false,"excerpt":"HTTP\/2 is still very much new to Java, and as such, there are just two libraries who support it - Jetty (from 9.3), and Netty (in alpha). If you're going the Jetty way (as I have), you'll need to add their ALPN library to your boot classpath. Note: Jetty 9.3.x\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=1845"}],"version-history":[{"count":1,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1845\/revisions"}],"predecessor-version":[{"id":1846,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1845\/revisions\/1846"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=1845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=1845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=1845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}