[IntelliJ] ์ธํ…”๋ฆฌ์ œ์ด ๋ฒ„๋ฒ…์ž„, ๋Š๋ ค์ง ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ• (VM Option ์„ค์ •)

2024. 6. 24. 09:04ใ†IntelliJ

728x90

 

 

์ธํ…”๋ฆฌ์ œ์ด Ultimate ์„ ๊ตฌ๋งคํ•˜๊ณ  ์ž˜ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์–ด๋Š๋‚  ๊ฐ‘์ž๊ธฐ ๋ฒ„๋ฒ…์ด๊ณ , ๋Š๋ ค์กŒ๋‹ค. 

์ฒ˜์Œ์—๋Š” ๊ตฌ๊ธ€๋งํ•œ๋‹ค๊ณ  ์‹คํ–‰ํ•œ ํฌ๋กฌ ์ฐฝ๋“ค์ด ๋„ˆ๋ฌด ๋งŽ์•„์ ธ์„œ ์ธ๊ฐ€? ์‹ถ์–ด์„œ ๋ชจ๋‘ ๋‹ค ์ •๋ฆฌ๋„ ํ•ด๋ณด๊ณ  ํ–ˆ๋Š”๋ฐ๋„ ๊ทธ๋Œ€๋กœ์˜€๋‹ค. 

๊ทธ๋ฆฌ๊ณ  ์˜ˆ์ „์—๋„ ๋น„์Šทํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด์„œ ์ด๋ฏธ VM Option ์„ค์ •์œผ๋กœ ์ตœ๋Œ€ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น๋„ 4096m ์ฆ‰ 4G๊นŒ์ง€ ์žก๋„๋ก ์„ค์ •๋„ ํ–ˆ๋‹ค. ๊ทธ๋•Œ ์ด๋ ‡๊ฒŒ ์„ค์ •ํ•˜๊ณ  ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋œ ๋“ฏ ํ–ˆ๋Š”๋ฐ.. ๋˜ ๋น„์Šทํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ผ๋‹จ ๋ฒ„๋ฒ…๊ฑฐ๋ฆฌ๊ณ , ์‹คํ–‰๋„ ๋„ˆ๋ฌด ๋Š๋ ธ๋‹ค. 

 

์•Œ์•„๋ณด๋‹ˆ IntlliJ IDEA ๋ฒ„๋ฒ…๊ฑฐ๋ฆฌ๋Š” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋ฉ”๋ชจ๋ฆฌ ์ตœ์ ํ™” ์™ธ์—๋„ ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ์ตœ์ ํ™” ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. 

 

1๏ธโƒฃ ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ด€๋ฆฌ 

์•Œ์•„๋ณด๋‹ˆ ๋„ˆ๋ฌด ๋งŽ์€ ํ”Œ๋Ÿฌ๊ทธ์ธ์ธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์„ฑ๋Šฅ์— ์˜ํ–ฅ์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค. 

(๊ทผ๋ฐ ๋‚˜๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์—„์ฒญ ๋งŽ์ด ์„ค์น˜ํ•œ ํŽธ์ด ์•„๋‹ˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ๋•Œ๋ฌธ์— ๋ฒ„๋ฒ…๊ฑฐ๋ฆฐ ๊ฑด ์•„๋‹ˆ์—ˆ๋‹ค.)

 

2๏ธโƒฃ ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰์…˜ ์ตœ์ ํ™” (ํ•ด๊ฒฐํ•œ ๋ฐฉ๋ฒ•) โญ

๊ฐ€๋น„์ง€ ์ปฌ๋ ‰์…˜ (GC) ์˜ ์„ค์ •์„ ์ตœ์ ํ™”ํ•˜์—ฌ ์„ฑ๋Šฅ์„ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ๋‹ค. 

-> ๋‚ด๊ฐ€ ์ด๋ฒˆ์— ํ•ด๊ฒฐํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค. ๊ธฐ์กด์— VM Option ์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ ๋Š˜๋ ค์„œ ์‚ฌ์šฉ์€ ํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. 

 

[Help -> Edit Custom VM Options] ์—์„œ VM ์˜ต์…˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ–ˆ๋‹ค. 

-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:InitiatingHeapOccupancyPercent=45
-XX:+UseStringDeduplication

 

๊ทธ๋žฌ๋”๋‹ˆ ๋ฒ„๋ฒ…๊ฑฐ๋ฆผ์ด ์—†์–ด์กŒ๋‹ค..! ํ•ด๊ฒฐ..!!! 

๐Ÿ‘ฉ‍๐Ÿ’ป ์ธํ…”๋ฆฌ์ œ์ด๋ฅผ ๊ธฐ๋ณธ ์„ค์ •์œผ๋กœ ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋ฉด ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋ถ€์กฑํ•ด์„œ ๋Š๋ ค์ง€๋Š” ํ˜„์ƒ์ด ๋‚˜ํƒ€๋‚˜๊ธฐ ๋•Œ๋ฌธ์— VM ์„ค์ •์„ ์ถ”๊ฐ€, ๋ณ€๊ฒฝ ํ•ด์ค˜์•ผ ํ•œ๋‹ค. 

 

* ์˜ต์…˜ ์„ค๋ช… 

-XX:+UseG1GC : G1(Garbage First) ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค์ •
(G1 GC๋Š” ๋Œ€๊ทœ๋ชจ ํž™ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ฐ€์ง„ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ ํ•ฉํ•œ ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰ํ„ฐ, ์‘๋‹ต ์‹œ๊ฐ„๊ณผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ผ๊ด€์„ฑ์„ ์œ ์ง€ํ•˜๋ฉด์„œ ์งง์€ GC ์ผ์‹œ ์ค‘์ง€๋ฅผ ๋ชฉํ‘œ๋กœ ํ•œ๋‹ค.) 

 

-XX:MaxGCPauseMillis=200 : ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰์…˜ ์ค‘ ์ตœ๋Œ€ ์ค‘๋‹จ ์‹œ๊ฐ„์„ 200 ๋ฐ€๋ฆฌ์ดˆ๋กœ ์„ค์ •

 

 -XX:InitiatingHeapOccupancyPercent=45 : ํž™ ๋ฉ”๋ชจ๋ฆฌ์˜ 45%๊ฐ€ ์‚ฌ์šฉ๋˜๋ฉด ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰์…˜์„ ์‹œ์ž‘

(ํž™ ๋ฉ”๋ชจ๋ฆฌ์˜ 45%๊ฐ€ ์‚ฌ์šฉ๋˜์—ˆ์„ ๋•Œ G1 GC๊ฐ€ ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰์…˜์„ ํŠธ๋ฆฌ๊ฑฐํ•œ๋‹ค.)

 

-XX:+UseStringDeduplication : ๋ฌธ์ž์—ด ์ค‘๋ณต ์ œ๊ฑฐ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค์ •

(์ด ์˜ต์…˜์€ G1 GC์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ๋˜๋ฉฐ, ํž™ ๋‚ด์—์„œ ๋™์ผํ•œ ๋ฌธ์ž์—ด์ด ์—ฌ๋Ÿฌ ๋ฒˆ ์กด์žฌํ•  ๊ฒฝ์šฐ ์ด๋ฅผ ์ œ๊ฑฐํ•˜์—ฌ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ ˆ์•ฝํ•œ๋‹ค.)

 

 

4๏ธโƒฃ ๋ฉ”๋ชจ๋ฆฌ ์„ค์ • ํ™•์ธ ๋ฐ ์กฐ์ • 

์ธํ…”๋ฆฌ์ œ์ด์˜ ๋ฉ”๋ชจ๋ฆฌ ์„ค์ •์„ ํ™•์ธํ•˜๊ณ  ์ ์ ˆํ•˜๊ฒŒ ์กฐ์ •ํ•˜๊ธฐ. 

 

[Help -> Edit Custom VM Options] ์—์„œ VM ์˜ต์…˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ–ˆ๋‹ค.

-Xms4096m
-Xmx4096m

 

 

 

-> 3๏ธโƒฃ, 4๏ธโƒฃ ๋ฅผ ๊ฐ™์ด ํ•ด์ฃผ๋ฉด ์•„๋งˆ ๋Œ€๋ถ€๋ถ„์˜ ์ธํ…”๋ฆฌ์ œ์ด ๋ฒ„๋ฒ…์ž„, ๋Š๋ ค์ง ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋‹ค ! 

 

 

 

๐Ÿ€

๊ทธ๋ฆฌ๊ณ  ์ถ”๊ฐ€๋กœ ๊ตฌ๊ธ€๋งํ•˜๋ฉด์„œ ์•Œ๊ฒŒ๋œ ๋ธ”๋กœ๊ทธ์ธ๋ฐ 

ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ๋ฅผ ํ†ตํ•ด ์ตœ์ ํ™”๋œ VM ์„ค์ •์„ ์ถ”์ฒœํ•˜๋Š” ๊ธ€์ด๋‹ค. 

https://snow-line.tistory.com/34

 

IntelliJ Memory Option ์ตœ์ ํ™”

IntelliJ๋ฅผ ๊ธฐ๋ณธ ์„ค์ •์œผ๋กœ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋ถ€์กฑํ•ด์„œ ๋Š๋ ค์ง€๋Š” ํ˜„์ƒ์ด ๋‚˜ํƒ€๋‚˜๊ธฐ ๋–„๋ฌธ์— VM ์„ค์ •์„ ๋ณ€๊ฒฝํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” Memory ์˜ต์…˜ ๊ฐ’ ๋ณ€๊ฒฝ๊ณผ ์‹คํ–‰ ์‹œ๊ฐ„์„ ์ธก์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. 1. ์‚ฌ

snow-line.tistory.com

์ฐธ๊ณ ํ•ด์„œ VM ์„ค์ •ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค. 

728x90