spring-cloud/spring-cloud-openfeign

Improve memory consumption of SpringEncoder.encodeWithMessageConverter

lucaspouzac opened this issue · 1 comments

During loadtest, I observe an abnormal memory consumption during iterate customizer. Maybe it possible to initialize this only during StringEncoder instantiation ?

Versions :

  • Spring boot 3.0.13
  • spring cloud openfeign : 4.0.2

https://github.com/spring-cloud/spring-cloud-openfeign/blob/v4.0.4/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SpringEncoder.java#L122

image

Thanks for pointing this out @lucaspouzac. Initialising it in constructor would be too early (hence the use of ObjectProvider), but I'll modify it to ensure it's only run once.