{"id":2710,"date":"2021-08-08T20:39:28","date_gmt":"2021-08-08T11:39:28","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=2710"},"modified":"2021-08-10T14:53:06","modified_gmt":"2021-08-10T05:53:06","slug":"spring-boot-app-%eb%8f%84%ec%bb%a4%eb%9d%bc%ec%9d%b4%ec%a7%95","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=2710","title":{"rendered":"Spring Boot App \ub3c4\ucee4\ub77c\uc774\uc9d5"},"content":{"rendered":"<h1>Spring Boot App \ub3c4\ucee4\ub77c\uc774\uc9d5<\/h1>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/57271442\/how-can-i-decrease-spring-boot-application-memory-usage-in-docker?rq=1\">\ucc38\uc870<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/44491257\/how-to-reduce-spring-boot-memory-usage\">\ucc38\uc870<\/a><\/p>\n<p><a href=\"https:\/\/spring.io\/blog\/2015\/12\/10\/spring-boot-memory-performance\">\ucc38\uc870<\/a><\/p>\n<p>\uc65c hello world app \uc774 \uc218\ubc31\uba54\uac00 \uba54\ubaa8\ub9ac\uac00 \ud544\uc694\ud560\uae4c?<\/p>\n<h2>\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc2e4\ud589\uc744 \uc704\ud55c \ucd5c\uc18c \uba54\ubaa8\ub9ac<\/h2>\n<p><code>Spring Boot<\/code> \uac00 \uad6c\ub3d9\ud558\uae30 \uc704\ud574\uc11c\ub294 \ucd5c\uc18c 75~100M \uc758 \uba54\ubaa8\ub9ac\uac00 \uc694\uad6c\ub429\ub2c8\ub2e4.<\/p>\n<h2>Docker \uba54\ubaa8\ub9ac \uc6a9\ub7c9 \uc81c\ud55c<\/h2>\n<pre><code class=\"language-bash\">docker run -m 75MB -p 8080:8080 -e JAVA_OPTS=&quot;-Xmx30M -Xms30M&quot;<\/code><\/pre>\n<p><code>-m<\/code> \ub610\ub294 <code>--memory<\/code> \uc635\uc158\uc744 \uc774\uc6a9\ud574 \uc0ac\uc6a9\uac00\ub2a5\ud55c \ucd5c\ub300 \uba54\ubaa8\ub9ac\ub97c \uc81c\ud55c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>nomad \uc5d0\uc11c\uc758 \uc124\uc815<\/h2>\n<p><code>memory_hard_limit<\/code> \uc744 \uc774\uc6a9\ud558\uc5ec <code>docker<\/code> \uc5d0 \uba54\ubaa8\ub9ac \uc81c\ud55c \uc124\uc815\uc744 \uc804\ub2ec\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n\ub2e8\uc704\ub294 <code>MB<\/code> \uc785\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-nomad\">job &quot;hello&quot; {\n  datacenters = [&quot;dc1&quot;]\n  group &quot;echo&quot; {\n    count = 1\n    task &quot;server&quot; {\n      driver = &quot;docker&quot;\n      # user = &quot;nobody&quot;\n      config {\n        image = &quot;hashicorp\/http-echo:latest&quot;\n        args = [\n          &quot;-listen&quot;, &quot;:8080&quot;,\n          &quot;-text&quot;, &quot;Hello and welcome to ${NOMAD_IP_http} running on port 8080&quot;,\n        ]\n        memory_hard_limit = 4000\n      }\n\n      resources {\n        memory = 1000\n        network {\n          port &quot;http&quot; {\n            static = 8080\n          }\n        }\n      }\n    }\n  }\n}<\/code><\/pre>\n<h2>UseContainerSupport<\/h2>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/54516988\/what-does-usecontainersupport-vm-parameter-do\">\ucc38\uc870<\/a><\/p>\n<p>JDK 10 \ubd80\ud130 \ub3c4\uc785\ub418\uc5c8\uace0(\ub514\ud3f4\ud2b8\ub294 \ud65c\uc131\ud654),<br \/>\nJDK 1.8.0_191 \ubd80\ud130 JDK8 \ubc84\uc804\uc5d0\ub3c4 \uc801\uc6a9\ub41c \uc635\uc158\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc704 \uc635\uc158\uc774 \uc788\uae30 \uc804\uc5d0\ub294 \ucee8\ud14c\uc774\ub108\uc758 \uba54\ubaa8\ub9ac \uc81c\ud55c\uc744 \ubb34\uc2dc\ud558\uace0,<br \/>\nJDK \uac00 \uc790\uccb4\uc801\uc73c\ub85c \uba54\ubaa8\ub9ac \uc124\uc815\uc744 \ud588\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uac83\uc774 \ubb38\uc81c\uac00 \ub418\uc5b4, \ub514\ud3f4\ud2b8\ub85c \ud65c\uc131\ud654\ub418\uc5b4<br \/>\n\ucee8\ud14c\uc774\ub108 \uba54\ubaa8\ub9ac \uc81c\ud55c\uc744 \uc801\uc6a9\ubc1b\uac8c \ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot App \ub3c4\ucee4\ub77c\uc774\uc9d5 \ucc38\uc870 \ucc38\uc870 \ucc38\uc870 \uc65c hello world app \uc774 \uc218\ubc31\uba54\uac00 \uba54\ubaa8\ub9ac\uac00 \ud544\uc694\ud560\uae4c? \uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc2e4\ud589\uc744 \uc704\ud55c \ucd5c\uc18c \uba54\ubaa8\ub9ac Spring Boot \uac00 \uad6c\ub3d9\ud558\uae30 \uc704\ud574\uc11c\ub294 \ucd5c\uc18c 75~100M \uc758 \uba54\ubaa8\ub9ac\uac00 \uc694\uad6c\ub429\ub2c8\ub2e4. Docker \uba54\ubaa8\ub9ac \uc6a9\ub7c9 \uc81c\ud55c docker run -m 75MB -p 8080:8080 -e JAVA_OPTS=&quot;-Xmx30M -Xms30M&quot; -m \ub610\ub294 &#8211;memory \uc635\uc158\uc744 \uc774\uc6a9\ud574 \uc0ac\uc6a9\uac00\ub2a5\ud55c \ucd5c\ub300 \uba54\ubaa8\ub9ac\ub97c \uc81c\ud55c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=2710\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2710","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2710"}],"version-history":[{"count":15,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2710\/revisions"}],"predecessor-version":[{"id":2733,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2710\/revisions\/2733"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}