Spring RestTemplate to WebClient causes OutOfMemoryError

Spring Boot's migration from RestTemplate to WebClient enhances performance via concurrency and non-blocking I/O. However, it led to OutOfMemoryError due to insufficient direct buffer memory. By analyzing the application with yCrash and increasing the maximum direct memory size, the issue was resolved, allowing successful image uploads without crashes.

Up ↑