After upgrading Wicket from 6.19 to 6.20 we are discovering massive unnecessary creation of CGLIB-Classes. After debugging the issue occurs every time an old page version is requested from PageStore that has an injected (@SpringBean) - member . If this happens a new proxy will be created every time. This leads to permgen waste and in the end to OutOfMemoryErrors and crashes. In 6.19. this error doesn't occur. For reproducing load any older version of a versioned page and a new class is loaded in ClassLoader (WICKET_WICKET_<anyInjectedSpringBean>$$EnhancerByCGLIB...<anyHash>)
In the attached screenshots you can see the difference between the two versions in one example (GarageService - a functional, injected service). The behaviour of the images occurs after restarting the Glassfish-server, deploy of the application. After visiting one site, using it and pressing the back button there are multiple GarageServices in the permgen available.
Before update (6.19):
After update (6.20):
Maybe this happens in Wicket 7, too. But currently not checked.