I have a memory leak in my spring cloud gateway instance which cause in half day to have out of direct memory error in a live environment. I'm not able to reproduce the issue in a development environment. What's the best way to debug data buffer creation and release to know where is this memory leak ? I didn't find anything using JMX to find an indicator of this direct memory usage. What are the logs I can enable to see what happen in spring cloud gateway ?
below my build.gradle
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "com.neovisionaries:nv-i18n:1.18"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.1"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-configuration-processor"
implementation 'com.atlassian.commonmark:commonmark:0.13.0'
implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.13.0'
implementation 'com.atlassian.commonmark:commonmark-ext-gfm-strikethrough:0.13.0'
implementation 'org.springframework.retry:spring-retry'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
implementation 'org.springframework.security:spring-security-oauth2-jose'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.cloud:spring-cloud-starter'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
implementation 'org.springframework.cloud:spring-cloud-starter-stream-kafka'
implementation "org.springframework.integration:spring-integration-core:5.4.3"
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"
implementation "org.jetbrains.kotlin:kotlin-reflect"
// Enabling caching features
compile 'org.ehcache:ehcache:3.2.0'
compile 'javax.cache:cache-api'
compile 'org.springframework.boot:spring-boot-starter-cache'
compile "org.apache.httpcomponents:httpmime:4.5.2"
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile('org.jolokia:jolokia-core')
compile 'commons-io:commons-io:2.5'
compile "commons-validator:commons-validator:1.6"