Spring 5.1.8
Whilst converting a particularly complex ball-of-mud legacy application from XML config to @Configuration-style config, I am finding that diagnosing circular references that trigger BeanCurrentlyInCreationExceptions causes an OutOfMemoryError before any actual exception is thrown during context initialisation. This doesn't happn with the pure XML-based config, only when I mix Java and XML styles.
When I look at the hprof file, 96% of the 2.5GB heap is retained by the DefaultSingletonBeanRegistry#suppressedExceptions field, which is full of massively-nested BeanCreationExceptions - 12592 of them, in this case.
It woul make sense to me if the suppressedExceptions field were to have a size limiter added, to prevent it growing so large. It's only there for diagnostics, and 12000+ exceptons isn't going to help anyone. I on't know what a sensible size imit would be, but more than a few dozen would seem to be unecessary and unhelpful.
In my case, the limiter would at least allow the context init to fail "gracefully". I don't know what it is about my set up, but its much too complex for me to post as a test case, sorry.