{"id":137601,"date":"2025-09-23T17:41:00","date_gmt":"2025-09-23T14:41:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=137601"},"modified":"2025-09-23T12:26:35","modified_gmt":"2025-09-23T09:26:35","slug":"memory-usage-optimization-in-spring-boot","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html","title":{"rendered":"Memory Usage Optimization In Spring Boot"},"content":{"rendered":"<h2 class=\"wp-block-heading\">1. Introduction<\/h2>\n<p>A basic Spring Boot application with an embedded Tomcat server would consume 100 MB of memory when launched. JVM memory consists of&nbsp;<code>Heap<\/code>,&nbsp;<code>Metaspace<\/code>,&nbsp;<code>Overhead<\/code>, and&nbsp;<code>Native<\/code>&nbsp;memories. <\/p>\n<ul class=\"wp-block-list\">\n<li><code>Heap<\/code>&nbsp;is used for object storage and garbage collection. The garbage collector automatically manages memory by reclaiming space from unused objects. The heap is the largest chunk of memory and might allocate between <code>50%<\/code> and <code>80%<\/code> of the total available system memory for the JVM. <\/li>\n<li><code>Metaspace<\/code>&nbsp;is used to store metadata about classes. It replaces <code>PermGen<\/code> since Java 8+<\/li>\n<li><code>Overhead<\/code>&nbsp;is used for thread management, etc. <\/li>\n<li><code>Native<\/code>&nbsp;is used to interact with the operating system.<\/li>\n<\/ul>\n<p>In this example, I will explain why this happens and examine ways to reduce memory usage without impacting application functionality.<\/p>\n<h2 class=\"wp-block-heading\">2. Setup<\/h2>\n<h3 class=\"wp-block-heading\"><a name=\"step21\"><\/a>2.1 Spring Boot 3.x Web Application<\/h3>\n<p>In this step, I will create a Gradle Java 21 Spring Boot 3 project via <a href=\"https:\/\/start.spring.io\/\">Spring IO Initializr<\/a> with the following common libraries:<\/p>\n<ul class=\"wp-block-list\">\n<li>Spring Web<\/li>\n<li>Lombok Developer Tools<\/li>\n<li>Validation I\/O<\/li>\n<li>Spring Security<\/li>\n<li>Spring Boot Actuator Ops<\/li>\n<li>Spring Session for Spring Data Redis Web<\/li>\n<li>Config Client Spring Cloud Config<\/li>\n<\/ul>\n<p>Unzip the generated zip file and output the generated <code>build.gradle<\/code>.<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">plugins {\n\tid 'java'\n\tid 'org.springframework.boot' version '3.4.10'\n\tid 'io.spring.dependency-management' version '1.1.7'\n}\n\ngroup = 'org.jcg.zheng.demo21G'\nversion = '0.0.1-SNAPSHOT'\ndescription = 'Demo memory usage project for Spring Boot'\n\njava {\n\ttoolchain {\n\t\tlanguageVersion = JavaLanguageVersion.of(21)\n\t}\n}\n\nconfigurations {\n\tcompileOnly {\n\t\textendsFrom annotationProcessor\n\t}\n}\n\nrepositories {\n\tmavenCentral()\n}\n\next {\n\tset('springCloudVersion', \"2024.0.2\")\n}\n\ndependencies {\n\timplementation 'org.springframework.boot:spring-boot-starter-actuator'\n\timplementation 'org.springframework.boot:spring-boot-starter-security'\n\timplementation 'org.springframework.boot:spring-boot-starter-validation'\n\timplementation 'org.springframework.boot:spring-boot-starter-web'\n\timplementation 'org.springframework.cloud:spring-cloud-config-server'\n\timplementation 'org.springframework.session:spring-session-data-redis'\n\tcompileOnly 'org.projectlombok:lombok'\n\tannotationProcessor 'org.projectlombok:lombok'\n\ttestImplementation 'org.springframework.boot:spring-boot-starter-test'\n\ttestImplementation 'org.springframework.security:spring-security-test'\n\ttestRuntimeOnly 'org.junit.platform:junit-platform-launcher'\n}\n\ndependencyManagement {\n\timports {\n\t\tmavenBom \"org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}\"\n\t}\n}\n\ntasks.named('test') {\n\tuseJUnitPlatform()\n}\n<\/pre>\n<h3 class=\"wp-block-heading\">2.2 Install VisualVM<\/h3>\n<p>In this step, I will install the VisualVM tool as it isn&#8217;t included in JDK21.<\/p>\n<ul class=\"wp-block-list\">\n<li>Go to the official site: <a>https:\/\/visualvm.github.io\/<\/a> and download the latest release (ZIP for Windows, tar.gz for Linux\/macOS)<\/li>\n<li>Extract and Install<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\"><a name=\"step23\"><\/a>2.3 Start the Spring Boot Application<\/h3>\n<p>In this step, I will start the Spring Boot application created at <a href=\"#step21\">step 2.1<\/a> without any modification via the &#8220;<code>gradlew bootRun<\/code>&#8221; command and capture the server log.<\/p>\n<p><span style=\"text-decoration: underline\"><em>gradlew bootRun<\/em><\/span><\/p>\n<pre class=\"brush:plain\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;gradlew bootRun\nStarting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details\n\n&gt; Task :bootRun\n\n  .   ____          _            __ _ _\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\n =========|_|==============|___\/=\/_\/_\/_\/\n\n :: Spring Boot ::               (v3.4.10)\n\n2025-09-21T17:42:07.553-05:00  INFO 19768 --- [sbmemory21g] [           main] o.j.z.d.s.Sbmemory21gApplication         : Starting Sbmemory21gApplication using Java 21.0.7 with PID 19768 (C:\\MaryZheng\\workspace\\sbmemory21g\\build\\classes\\java\\main started by zzhen in C:\\MaryZheng\\workspace\\sbmemory21g)\n2025-09-21T17:42:07.555-05:00  INFO 19768 --- [sbmemory21g] [           main] o.j.z.d.s.Sbmemory21gApplication         : No active profile set, falling back to 1 default profile: \"default\"\n2025-09-21T17:42:08.185-05:00  INFO 19768 --- [sbmemory21g] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=2723bc09-5e66-38ec-96ea-3c4721fe1b70\n2025-09-21T17:42:08.382-05:00  INFO 19768 --- [sbmemory21g] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)\n2025-09-21T17:42:08.394-05:00  INFO 19768 --- [sbmemory21g] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]\n2025-09-21T17:42:08.395-05:00  INFO 19768 --- [sbmemory21g] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat\/10.1.46]\n2025-09-21T17:42:08.431-05:00  INFO 19768 --- [sbmemory21g] [           main] o.a.c.c.C.[Tomcat].[localhost].[\/]       : Initializing Spring embedded WebApplicationContext\n2025-09-21T17:42:08.432-05:00  INFO 19768 --- [sbmemory21g] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 847 ms\n2025-09-21T17:42:08.794-05:00  WARN 19768 --- [sbmemory21g] [           main] .s.s.UserDetailsServiceAutoConfiguration :\n\nUsing generated security password: b102c837-4262-4e5f-b418-f3a6798998f6\n\nThis generated password is for development use only. Your security configuration must be updated before running your application in production.\n\n2025-09-21T17:42:08.805-05:00  INFO 19768 --- [sbmemory21g] [           main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with UserDetailsService bean with name inMemoryUserDetailsManager\n2025-09-21T17:42:08.875-05:00  INFO 19768 --- [sbmemory21g] [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint beneath base path '\/actuator'\n2025-09-21T17:42:08.953-05:00  INFO 19768 --- [sbmemory21g] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '\/'\n2025-09-21T17:42:08.963-05:00  INFO 19768 --- [sbmemory21g] [           main] o.j.z.d.s.Sbmemory21gApplication         : Started Sbmemory21gApplication in 1.703 seconds (process running for 2.002)\n 80% EXECUTING [1h 58m 25s]\n<\/pre>\n<p>The server log shows the Spring Boot 3.4.10 web application is started.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"step3\"><\/a>3. Monitor Via VisualVM<\/h2>\n<p>Launch VisualVM and monitor the basic Spring Boot application started at <a href=\"#step23\">step 2.3<\/a>.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/JVM_monitor.jpg\"><img decoding=\"async\" width=\"756\" height=\"593\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/JVM_monitor.jpg\" alt=\"How to Reduce Spring Boot Memory Usage\" class=\"wp-image-137625\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/JVM_monitor.jpg 756w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/JVM_monitor-300x235.jpg 300w\" sizes=\"(max-width: 756px) 100vw, 756px\" \/><\/a><figcaption class=\"wp-element-caption\">Figure 1. JVM Monitor<\/figcaption><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li>The <code>pid<\/code> is <code>19768<\/code>.<\/li>\n<li>The current committed heap size is <code>104857600B<\/code>. It is between <code>-Xms<\/code> and <code>-Xmx<\/code>.<\/li>\n<li>The actual used heap size is ranged from <code>25MB<\/code> to <code>90MB<\/code>.<\/li>\n<li>The max heap size is <code>4G<\/code> and can be set by the <code>-Xmx<\/code><\/li>\n<li>The <code>Metaspace<\/code> size average is <code>42MB<\/code>.<\/li>\n<li>The total loaded classes count is <code>10505<\/code>.<\/li>\n<\/ul>\n<p>So, this Spring boot application consumes about 67MB-132MB memory. Here are the main reasons why it takes that much memory:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul class=\"wp-block-list\">\n<li>Spring Boot Framework overhead &#8211; spring context initialized thousands of classes, dependency injection graph resolved, and stored reflection metadata.<\/li>\n<li>Embedded Servlet Container &#8211; Tomcat threads, request\/response buffers, servlet mappings, and with default 200 threads pool.<\/li>\n<li>Logging &#8211; Logging initialization and configuration.<\/li>\n<li>Annotation scanning for <code>@Configuration<\/code>, <code>@Component<\/code>, <code>@Entity<\/code>, and <code>@Service<\/code> can add lots of objects.<\/li>\n<li>Spring Boot Actuator includes health checks and metrics.<\/li>\n<li>Jackson\/JSON libraries cache type metadata.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\"><a name=\"step4\"><\/a>4. Monitor via Commands<\/h2>\n<h3 class=\"wp-block-heading\">4.1 The Jcmd command<\/h3>\n<p>You can get the memory usage via the <code>jcmd<\/code> command.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jcmd 19768 GC.heap_info<\/em><\/span><\/p>\n<pre class=\"brush:plain;highlight:[3,5]\">C:\\Program Files\\Java\\jdk-21\\bin&gt;jcmd 19768 GC.heap_info\n19768:\n garbage-first heap   total 102400K, used 62525K [0x0000000704e00000, 0x0000000800000000)\n  region size 2048K, 22 young (45056K), 4 survivors (8192K)\n Metaspace       used 40041K, committed 40640K, reserved 1114112K\n  class space    used 5635K, committed 5888K, reserved 1048576K<\/pre>\n<ul class=\"wp-block-list\">\n<li>Line 3: <code>Heap<\/code> size: <code>102400k<\/code>, used heap size is <code>62525K<\/code><\/li>\n<li>Line 5: <code>Metaspace<\/code> used size: <code>40041K<\/code>.<\/li>\n<\/ul>\n<p>Here is another example with the <code>jcmd<\/code> command and listing the first 10 items.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jcmd 13352 GC.class_histogram<\/em><\/span><\/p>\n<pre class=\"brush:plain\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jcmd 13352 GC.class_histogram\n13352:\n num     #instances         #bytes  class name (module)\n-------------------------------------------------------\n   1:         68467        8375992  [B (java.base@21.0.7)\n   2:         66137        1587288  java.lang.String (java.base@21.0.7)\n   3:         10956        1294000  java.lang.Class (java.base@21.0.7)\n   4:         33264        1064448  java.util.concurrent.ConcurrentHashMap$Node (java.base@21.0.7)\n   5:         12388         667024  [Ljava.lang.Object; (java.base@21.0.7)\n   6:          5335         656432  [I (java.base@21.0.7)\n   7:         13316         532640  java.util.LinkedHashMap$Entry (java.base@21.0.7)\n   8:          7755         496320  java.util.LinkedHashMap (java.base@21.0.7)\n   9:          6564         473048  [Ljava.util.HashMap$Node; (java.base@21.0.7)\n  10:           334         327328  [Ljava.util.concurrent.ConcurrentHashMap$Node; (java.base@21.0.7)<\/pre>\n<h3 class=\"wp-block-heading\">4.2 The Jmap Command<\/h3>\n<p>The <code>jmap<\/code> command outputs the retained size and order by the descending order.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jmap -histo <\/em><\/span><\/p>\n<pre class=\"brush:plain\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jmap -histo 13352\n num     #instances         #bytes  class name (module)\n-------------------------------------------------------\n   1:        119432       12819960  [B (java.base@21.0.7)\n   2:        111350        4506600  [Ljava.lang.Object; (java.base@21.0.7)\n   3:         62023        2480920  java.util.TreeMap$Entry (java.base@21.0.7)\n   4:        102408        2457792  java.lang.String (java.base@21.0.7)\n   5:         10491        1645864  [I (java.base@21.0.7)\n   6:         11163        1318736  java.lang.Class (java.base@21.0.7)\n   7:         36762        1176384  java.util.concurrent.ConcurrentHashMap$Node (java.base@21.0.7)\n   8:          3451        1109904  [C (java.base@21.0.7)\n   9:         11883        1045704  java.lang.reflect.Method (java.base@21.0.7)\n  10:         16221        1038144  java.util.LinkedHashMap (java.base@21.0.7)<\/pre>\n<h3 class=\"wp-block-heading\">4.3 The Jstat Command<\/h3>\n<p>The <code>jstat<\/code> command outputs the memory usage for the <code>gc<\/code> process every 10 seconds.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jstat -gc  1000<\/em><\/span><\/p>\n<pre class=\"brush:plain\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jstat -gc 13352 1000\n    S0C         S1C         S0U         S1U          EC           EU           OC           OU          MC         MU       CCSC      CCSU     YGC     YGCT     FGC    FGCT     CGC    CGCT       GCT\n        0.0      2048.0         0.0        23.0      47104.0          0.0      26624.0      20984.7    42112.0    40993.7    6144.0    5744.2     11     0.042     2     0.047     4     0.004     0.094\n        0.0      2048.0         0.0        23.0      47104.0          0.0      26624.0      20984.7    42112.0    40993.7    6144.0    5744.2     11     0.042     2     0.047     4     0.004     0.094\n        0.0      2048.0         0.0        23.0      47104.0       2048.0      26624.0      20984.7    42112.0    40993.7    6144.0    5744.2     11     0.042     2     0.047     4     0.004     0.094\n<\/pre>\n<ul class=\"wp-block-list\">\n<li>S0C\/S0U, S1C\/S1U: Survivor spaces capacity\/used<\/li>\n<li>EC\/EC: Eden capacity\/used<\/li>\n<li>OC\/OU: Old generation capacity\/used<\/li>\n<li>MC\/MU: Metaspace capacity\/used<\/li>\n<li>CCSC\/CCSU: Compressed class space capacity\/used<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">4.4 Find the Total Physical Memory<\/h3>\n<p>In this step, I will use the <code>systeminfo<\/code> command to find my PC&#8217;s total physical memory.<\/p>\n<p><span style=\"text-decoration: underline\"><em>systeminfo | find &#8220;Total Physical Memory&#8221;<\/em><\/span><\/p>\n<pre class=\"brush:plain\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;systeminfo | find \"Total Physical Memory\"\nTotal Physical Memory:         16,069 MB\n\nC:\\MaryZheng\\workspace\\sbmemory21g&gt;<\/pre>\n<p>My PC&#8217;s total physical memory is 16GB, so the <code>MaxHeapSize<\/code> cannot exceed 4GB(1\/4 of total physical memory).<\/p>\n<h2 class=\"wp-block-heading\">5. Memory Usage Optimization<\/h2>\n<p>In this step, I will adjust the Spring Boot web application&#8217;s JVM memory options, Tomcat thread max count, Spring Bean lazy initialization and compare its memory footprint to the data captured at <a href=\"#step3\">step 3<\/a> and <a href=\"#step4\">4<\/a>.<\/p>\n<h3 class=\"wp-block-heading\">5.1 Adjust JVM Memory Options<\/h3>\n<p>Please refer to <a href=\"https:\/\/www.javacodegeeks.com\/explaining-advanced-jvm-options.html\" target=\"_blank\" rel=\"noreferrer noopener\">my other article<\/a> for adjusting the JVM memory options. Here are common JVM memory options:<\/p>\n<ul class=\"wp-block-list\">\n<li><code>-Xms#<\/code>&nbsp;sets the initial heap size when the JVM starts.<\/li>\n<li><code>-Xmx#<\/code>&nbsp;sets the maximum heap size for the JVM. Setting both initial and maximum heap size to the same value can avoid the overhead for heap resizing, but it can waste memory if not used.<\/li>\n<li><code>-Xmn#<\/code>&nbsp;sets the size of the young generation (part of the heap).<\/li>\n<li><code>-Xss#<\/code>&nbsp;sets the stack size for each thread.<\/li>\n<li><code>-XX:+HeapDumpOnOutOfMemoryError<\/code>&nbsp;generates a heap dump when an&nbsp;<code>OutOfMemoryError<\/code>&nbsp;occurs.<\/li>\n<li><code>-XX:HeapDumpPath={path_to_dump_file}<\/code>&nbsp;specifies the path location.<\/li>\n<li><code>-XX:+UseG1GC<\/code>: Use the G1 garbage collector.<\/li>\n<li><code>-XX:+UseConcMarkSweepGC<\/code>: Use the Concurrent Mark-Sweep (CMS) garbage collector.<\/li>\n<li><code>-XX:+UseParallelGC<\/code>: Use the parallel garbage collector.<\/li>\n<li><code>-XX:+AggressiveOpts<\/code>: Enable aggressive optimization settings for performance.<\/li>\n<li><code>-XX:MaxInlineLevel<\/code>: Control the maximum number of methods that can be inlined.<\/li>\n<li><code>-XX:MaxMetaspaceSize<\/code>: Set the maximum size of the Metaspace after JDK8.<\/li>\n<li><code>-XX:ReservedCodeCachedSize<\/code>: Reserve code cached size in bytes.<\/li>\n<li><code>-XX:+UseContainerSupport<\/code>: This is enabled by default since JDK10<\/li>\n<li><code>-XX:MaxRAMPercentage<\/code>: Configure the memory with percentage instead of hard code value.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">5.2 Adjust Tomcat Thread Configuration<\/h3>\n<p>In this step, I will adjust the Spring Boot Application Tomcat server configuration by setting the max Tomcat thread count to 4 (the Spring Boot application has a default max thread count of 200).<\/p>\n<p><span style=\"text-decoration: underline\"><em>application.properties<\/em><\/span><\/p>\n<pre class=\"brush:plain\">spring.application.name=sbmemory21g\n\n\/\/default 200\nserver.tomcat.threads.max=4\n\/\/default 10\nserver.tomcat.threads.min-space=2<\/pre>\n<p>After updating the Tomcat threads setting, start the Spring Boot application and capture its memory footprint via both VisualVM and the command line outlined at <a href=\"#step3\">step 3<\/a> and <a href=\"#step4\">4<\/a>.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jcmd GC.heap_info output<\/em><\/span><\/p>\n<pre class=\"brush:plain;highlight:[3,5]\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jcmd 14200 GC.heap_info\n14200:\n garbage-first heap   total 83968K, used 32453K [0x0000000704e00000, 0x0000000800000000)\n  region size 2048K, 3 young (6144K), 1 survivors (2048K)\n Metaspace       used 41358K, committed 42048K, reserved 1114112K\n  class space    used 5840K, committed 6144K, reserved 1048576K<\/pre>\n<p>Compare its Heap, Metaspace, threads, classes loaded to the data captured at <a href=\"#step3\">step 3<\/a>.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<tbody>\n<tr>\n<td><\/td>\n<td><strong>Basic Spring Boot with<\/strong> <strong>Default 200 threads<\/strong><\/td>\n<td><strong>Updated Spring Boot with 4 Threads<\/strong><\/td>\n<td><strong>Comparison Results<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Heap Used<\/strong><\/td>\n<td>62525K<\/td>\n<td>32453K<\/td>\n<td>reduced by 48%<\/td>\n<\/tr>\n<tr>\n<td><strong>Metaspace<\/strong><\/td>\n<td>40041K<\/td>\n<td>41358K<\/td>\n<td>increased by 3%<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Thread Started<\/strong><\/td>\n<td>34<\/td>\n<td>28<\/td>\n<td>reduced<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Classes Loaded<\/strong><\/td>\n<td>10505<\/td>\n<td>10488<\/td>\n<td>reduced<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>It trades memory footprint with throughput by reducing the thread count.<\/p>\n<h3 class=\"wp-block-heading\">5.3 Adjust Lazy Bean Initialization<\/h3>\n<p>In this step, I will adjust the Spring Boot Application lazy bean configuration.<\/p>\n<p><span style=\"text-decoration: underline\"><em>application.properties<\/em><\/span><\/p>\n<pre class=\"brush:plain\">spring.main.lazy-initialization=true<\/pre>\n<p>After updating the Tomcat thread setting, start the Spring Boot application and capture the memory usage.<\/p>\n<p><span style=\"text-decoration: underline\"><em>application.properties.java<\/em><\/span><\/p>\n<pre class=\"brush:plain;highlight:[3,5]\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jcmd 25168 GC.heap_info\n25168:\n garbage-first heap   total 98304K, used 53585K [0x0000000704e00000, 0x0000000800000000)\n  region size 2048K, 16 young (32768K), 3 survivors (6144K)\n Metaspace       used 38358K, committed 39040K, reserved 1114112K\n  class space    used 5376K, committed 5696K, reserved 1048576K<\/pre>\n<p>Compare its Heap, Metaspace, thread, classes loaded to the data captured at <a href=\"#step3\">step 3<\/a>.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<tbody>\n<tr>\n<td><\/td>\n<td><strong>Basic Spring Boot with Default Setting<\/strong><\/td>\n<td><strong>Updated Spring Boot Lazy Bean Initialization<\/strong><\/td>\n<td><strong>Comparison Results<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Heap Used<\/strong><\/td>\n<td>62525K<\/td>\n<td>53585K<\/td>\n<td>reduced by 15%<\/td>\n<\/tr>\n<tr>\n<td><strong>Metaspace<\/strong><\/td>\n<td>40041K<\/td>\n<td>38358K<\/td>\n<td>reduced by 4%<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Thread Started<\/strong><\/td>\n<td>34<\/td>\n<td>28<\/td>\n<td>-4<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Classes Loaded<\/strong><\/td>\n<td>10505<\/td>\n<td>9744<\/td>\n<td>reduced by 7%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>It trades memory footprint with latency by lazy initializing beans.<\/p>\n<h3 class=\"wp-block-heading\">5.4 Disable Unused Spring Feature<\/h3>\n<p>In this step, I will adjust the Spring Boot Application configuration to disable unused features.<\/p>\n<p><span style=\"text-decoration: underline\"><em>application.properties.java<\/em><\/span><\/p>\n<pre class=\"brush:plain\">spring.jmx.enabled=false\nspring.main.banner-mode=off<\/pre>\n<p>After updating the Tomcat thread setting, start the Spring Boot application and capture its memory usage.<\/p>\n<p><span style=\"text-decoration: underline\"><em>jcmd 28564 GC.heap_info<\/em><\/span><\/p>\n<pre class=\"brush:plain;highlight:[3,5]\">C:\\MaryZheng\\workspace\\sbmemory21g&gt;jcmd 28564 GC.heap_info\n28564:\n garbage-first heap   total 98304K, used 52560K [0x0000000704e00000, 0x0000000800000000)\n  region size 2048K, 26 young (53248K), 2 survivors (4096K)\n Metaspace       used 38385K, committed 39168K, reserved 1114112K\n  class space    used 5388K, committed 5760K, reserved 1048576K<\/pre>\n<p> Compare its memory, metaspace, thread, classes loaded to the data captured at <a href=\"#step3\">step 3<\/a>.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<tbody>\n<tr>\n<td><\/td>\n<td><strong>Basic Spring Boot with Default Setting<\/strong><\/td>\n<td><strong>Updated Spring Boot Disable JMX<\/strong><\/td>\n<td><strong>Comparison Results<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Heap Used<\/strong><\/td>\n<td>62525K<\/td>\n<td>52560K<\/td>\n<td>reduced by 15%<\/td>\n<\/tr>\n<tr>\n<td><strong>Metaspace<\/strong><\/td>\n<td>40041K<\/td>\n<td>38385K<\/td>\n<td>reduced by 4%<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Thread Started<\/strong><\/td>\n<td>34<\/td>\n<td>28<\/td>\n<td>-4<\/td>\n<\/tr>\n<tr>\n<td><strong>Total Classes Loaded<\/strong><\/td>\n<td>10505<\/td>\n<td>9765<\/td>\n<td>reduced by 7%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 class=\"wp-block-heading\">6. Container-Friendly Practices<\/h2>\n<p>There are several categories based on container-friendly guidelines when configuring JVM options.<\/p>\n<ul class=\"wp-block-list\">\n<li><code>-XX:+UseContainerSupport<\/code> to respect container memory limit.<\/li>\n<li>Configure memory with <code>-XX:MaxRAMPercentage=75.0<\/code> instead of hardcoding <code>-Xmx<\/code>.<\/li>\n<li>Consider <code>G1GC<\/code> (default in Java 9+) or <code>ZGC<\/code> for low-latency apps.<\/li>\n<li>Adjust GC threads if the container CPU is small\n<ul class=\"wp-block-list\">\n<li><code>-XX:ParallelGCThreads=2<\/code><\/li>\n<li><code>-XX:ConcGCThreads=2<\/code>.<\/li>\n<\/ul>\n<\/li>\n<li>Avoid Large Heap Defaults.<\/li>\n<li>Control Async\/Scheduled thread pools by setting the boundary, e.g. max pool size. max queue capacity, etc.<\/li>\n<li>Use smaller docker image<\/li>\n<li>Graceful shutdown and set shutdown timeout<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">7. Other Optimization Techniques<\/h2>\n<p>When tuning a Spring Boot web application, there are many optimization techniques beyond just memory and thread settings. They fall into several categories:<\/p>\n<ul class=\"wp-block-list\">\n<li>Database optimization &#8211; proper indexes, batch operations, caching, connection pool.<\/li>\n<li>Caching &#8211; Http caching and application-level caching.<\/li>\n<li>Security Optimizations &#8211; minimize Spring security filters in the chain.<\/li>\n<li>Code-level Best practices &#8211; avoid heavy object creation, use DTO instead of entities for API response, minimize reflection, reuse expensive resources, e.g. <code>ObjectMapper<\/code>.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">8. Conclusion<\/h2>\n<p>In this example, I created a simple Java Spring Web Application and monitored its memory usage via both <strong>VisualVM<\/strong> tool and <code>jcmd<\/code>, <code>jstat<\/code> commands. I repeatedly monitor the memory footprint for the same Spring Boot web application program after changing its thread pool, lazy-bean initialization, and disable JMX configuration. Please remember everything comes with price. The reduced memory footprint was traded with throughput and\/or latency. Don&#8217;t over-optimization the setting.<\/p>\n<h2 class=\"wp-block-heading\">9. Download<\/h2>\n<p>This was an example of a Java Spring Boot Web project.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/sbmemory21g.zip\"><strong>How to Reduce Spring Boot Memory Usage?<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction A basic Spring Boot application with an embedded Tomcat server would consume 100 MB of memory when launched. JVM memory consists of&nbsp;Heap,&nbsp;Metaspace,&nbsp;Overhead, and&nbsp;Native&nbsp;memories. Heap&nbsp;is used for object storage and garbage collection. The garbage collector automatically manages memory by reclaiming space from unused objects. The heap is the largest chunk of memory and might &hellip;<\/p>\n","protected":false},"author":128892,"featured_media":121875,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[218,854],"class_list":["post-137601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-memory","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Memory Usage Optimization In Spring Boot - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about memory usage optimization? Then check out our detailed examples!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Memory Usage Optimization In Spring Boot - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about memory usage optimization? Then check out our detailed examples!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-23T14:41:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mary Zheng\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mary Zheng\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html\"},\"author\":{\"name\":\"Mary Zheng\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/33e795ab61de7fab61ed89b4de1668f5\"},\"headline\":\"Memory Usage Optimization In Spring Boot\",\"datePublished\":\"2025-09-23T14:41:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html\"},\"wordCount\":1340,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"keywords\":[\"Memory\",\"Spring Boot\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html\",\"name\":\"Memory Usage Optimization In Spring Boot - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"datePublished\":\"2025-09-23T14:41:00+00:00\",\"description\":\"Interested to learn more about memory usage optimization? Then check out our detailed examples!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/memory-usage-optimization-in-spring-boot.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Memory Usage Optimization In Spring Boot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/33e795ab61de7fab61ed89b4de1668f5\",\"name\":\"Mary Zheng\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/cropped-Mary-Zheng-96x96.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/cropped-Mary-Zheng-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/cropped-Mary-Zheng-96x96.jpg\",\"caption\":\"Mary Zheng\"},\"description\":\"Mary graduated from the Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She worked as a lead Software Engineer where she led and worked with others to design, implement, and monitor the software solution.\",\"sameAs\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/mary-zheng\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Memory Usage Optimization In Spring Boot - Java Code Geeks","description":"Interested to learn more about memory usage optimization? Then check out our detailed examples!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html","og_locale":"en_US","og_type":"article","og_title":"Memory Usage Optimization In Spring Boot - Java Code Geeks","og_description":"Interested to learn more about memory usage optimization? Then check out our detailed examples!","og_url":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2025-09-23T14:41:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","type":"image\/jpeg"}],"author":"Mary Zheng","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Mary Zheng","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html"},"author":{"name":"Mary Zheng","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/33e795ab61de7fab61ed89b4de1668f5"},"headline":"Memory Usage Optimization In Spring Boot","datePublished":"2025-09-23T14:41:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html"},"wordCount":1340,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","keywords":["Memory","Spring Boot"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html","url":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html","name":"Memory Usage Optimization In Spring Boot - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","datePublished":"2025-09-23T14:41:00+00:00","description":"Interested to learn more about memory usage optimization? Then check out our detailed examples!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/memory-usage-optimization-in-spring-boot.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Memory Usage Optimization In Spring Boot"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/33e795ab61de7fab61ed89b4de1668f5","name":"Mary Zheng","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/cropped-Mary-Zheng-96x96.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/cropped-Mary-Zheng-96x96.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/cropped-Mary-Zheng-96x96.jpg","caption":"Mary Zheng"},"description":"Mary graduated from the Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She worked as a lead Software Engineer where she led and worked with others to design, implement, and monitor the software solution.","sameAs":["https:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/mary-zheng"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/137601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/128892"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=137601"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/137601\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/121875"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=137601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=137601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=137601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}