Skip to content

Application use a lot of memory with Bucket4j and Springboot 3 #486

Discussion options

You must be logged in to vote

Hello @williamjvr

You should do primary diagnostic by yourself. Configure JVM option to make heapdump on OOM. Or acquire heapdump manually. Then analyze heapdump in Eclipse Memory Analizer Tool(MAT). Without heapdump it is hard to answer where you were wrong.

A few notes about your code:

  1. You create one Redis connection per Bucket and one ProxyManager per bucket, it is waste of resources. Typically you should use only one proxyManager per application. Just create a bean fofor proxyManager.
  2. It is not nessesary to cache the buckets, if amount of buckets can not be predictable. Just create, use and forget bucket per each request.

I make a bet that MAT will show that cause of leak is connect…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@williamjvr
Comment options

@vladimir-bukhtoyarov
Comment options

Answer selected by vladimir-bukhtoyarov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants