0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IntelliJ が遅いときのチェック項目

Last updated at Posted at 2025-04-19

なんかいもインターネットに上げられてるけど、意外に日本語でまとまったものが無い気がする。。。

久しぶりに IntelliJ インストールしてなんか JUnit で書かれたユニットテスト実行すると、なんかクソ遅くてタダのテスト実行に3秒ぐらいかかることがあります。(今日)

毎回、『PC セットアップする度にまたこれだよ。。/etc/hosts に設定しないといけないやつなんだっけ?』となってるので書いておきます。

Before/After 比較

  • 初期設定:
  • 設定後:

レギュレーション

以下のコードを書いて、1回 JUnit 実行後に、少し編集して Ctrl + D で再実行して結果が見える前の体感時間。

note
設定前 6s
Runner を IntellJ に 1s~7s 何故かたまに詰まることがある
/etc/hosts に自ホスト名記入 < 1s (安定) これが必要

設定その1) Runner を IntelliJ に

言わずと知れたやつ。(ただ、最近だと Gradle のままでも早い? いやでもそんなの知らん

image.png

設定その2) /etc/hosts に自ホスト名を書く

Before

もう元がどうなってるか解らないですがこういうものの場合

127.0.0.1	localhost

hostname コマンドの結果が、my-computer だったとしたら以下の用に書き換えておきます。

127.0.0.1	localhost  my-computer my-computer.local
::1         localhost  my-computer my-computer.local

効果があるかどうか分からないやつ:その1)

最小サンプルでは変わらないと思いますが、IntelliJ に割り当てるメモリは増やしておきましょう。
(自分は 16GiB ぐらいを割り当てる事が多い(多すぎる気はするけど))

効果があるかどうか分からないやつ:その2)

ありとあらゆる 起動オプションに
-Djava.net.preferIPv4Stack=true
は入れてます。

image.png

効果があるかどうか分からないやつ:その3)

他のやつずいじk

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?