- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Description
JdkDynamicAopProxy allocates a lot of objects in findDefinedEqualsAndHashCodeMethods and in the constructor via AopProxyUtils.completeProxiedInterfaces (object arrays, collection instances) to compute whether the interfaces implement hashCode/equals methods.
This effect gets visible when creating several thousand (100000s) proxy instances. It would be neat to either have a built-in cache for these values or to be able to override these features so Spring Data could supply values from its caches.
Recorded allocations:
 
Right now, this isn't possible because the methods are private or being called within the constructor. Also, the implementation of invoke uses several package-private fields of ProxyConfig and other protected components.
We found this aspect while debugging a more significant memory issue via spring-projects/spring-data-commons#2831