Skip to content

Commit 744e387

Browse files
committed
JVM Memory Use Optimization: That dependency I removed was actually necessary. My program can't start without it (for GraphQL stuff) woops.
1 parent e0f291e commit 744e387

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

other-docs/2026-01-13-memory-optimization.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,7 @@ Thread stacks consume ~1MB each by default. Explicitly capping worker and schedu
9292

9393
---
9494

95-
### 6. Removing Unnecessary Dependencies (pom.xml)
96-
97-
Getting rid of stuff like this that was lying around:
98-
```xml
99-
<artifactId>spring-boot-starter-webflux</artifactId>
100-
<scope>test</scope>
101-
```
102-
*For this example specifically*, WebFlux pulls in Reactor and Netty, increasing classpath scanning, memory usage, and startup overhead even when unused.
103-
104-
---
105-
106-
### 7. Replace Executor Factories with Explicit ThreadPoolExecutor
95+
### 6. Replace Executor Factories with Explicit ThreadPoolExecutor
10796

10897
Making this change in `ExecutorConfig.java` (*the original code is what's commented out in the snippet*):
10998

@@ -135,7 +124,7 @@ Using an explicit `ThreadPoolExecutor` avoids unbounded task queues, enables bac
135124

136125
---
137126

138-
### 8. Remove Legacy Metrics
127+
### 7. Remove Legacy Metrics
139128

140129
Removed counters and gauges tied to deprecated code paths (e.g., legacy in-memory queue metrics). Got rid of stuff like (which relates to outdated, deprecated code):
141130
```java

springqpro-backend/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@
156156
<scope>test</scope>
157157
</dependency>
158158

159-
<!--<dependency>
159+
<dependency>
160160
<groupId>org.springframework.boot</groupId>
161161
<artifactId>spring-boot-starter-webflux</artifactId>
162162
<version>3.5.7</version>
163163
<scope>test</scope>
164-
</dependency>-->
164+
</dependency>
165165

166166
<dependency>
167167
<groupId>org.apache.commons</groupId>

0 commit comments

Comments
 (0)