Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6009

Massive creation of dynamic classes causes OutOfMemory (PermGen)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • 6.20.0
    • None
    • wicket-spring
    • Glassfish 4.1, Any OS, Any JDK

    Description

      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.

      Attachments

        1. wicket_spring_6_19.PNG
          20 kB
          Danny Christl
        2. wicket_spring_6_20.PNG
          28 kB
          Danny Christl

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dannyc Danny Christl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: