Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7517

Memory Leak for "fake" Request objects in ModelAdapterFactory with interface-based models

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Models Impl 1.4.6
    • Models Impl 1.4.8
    • Extensions
    • None

    Description

      The functionality added in SLING-5668 to dispose of OSGi services (or anything else needing disposal when creating a Sling Model object) based on the ServletRequest lifecycle only works if the ServletRequest object was actually created by the ServletContext. In some cases, applications make construct "fake" request object (primarily for use with SlingRequestProcessor). In these cases, since the ServletContext didn't create these requests, it won't call the requestDestroyed method when they are complete.

       

      The easiest way to resolve this is to only apply the special behavior in SLING-5668 to request objects actually created by the ServletContext and use the general-purpose ReferenceQueue method for all other requests (and all other adaptables).

       

      The fix in SLING-7470 was incomplete and only addressed class-based models. Interface-based models were not fixed.

      Attachments

        Issue Links

          Activity

            People

              justinedelson Justin Edelson
              justinedelson Justin Edelson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: