I have a class-loading problem in my app. We are using custom classloader and all is closed correctly but dynamic classes (com.sun.proxy.* and org.springframework.core.$Proxy
) are generated pretty wildly and metaspace keeps growing to the point where JVM runs out of metaspace
I have tried a lot of things including heap and memory historgram analysis but I think I need some way to track proxy generation. I need to detect:
- which objects are creating proxies
- created proxy name
Is there any library / code snippet for that? I know I can technically use bytebuddy but dont want to reinvent the wheel
Instead of using a Java agent, you should log the class loading via the
-verbose:class
flag and process this output.