You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Roland Foerther (JIRA)" <ji...@apache.org> on 2015/11/01 02:02:27 UTC

[jira] [Created] (WICKET-6016) AnnotProxyFieldValueFactory generating CGLIB proxies can eat up permgen space

Roland Foerther created WICKET-6016:
---------------------------------------

             Summary: AnnotProxyFieldValueFactory generating CGLIB proxies can eat up permgen space
                 Key: WICKET-6016
                 URL: https://issues.apache.org/jira/browse/WICKET-6016
             Project: Wicket
          Issue Type: Bug
          Components: wicket-spring
    Affects Versions: 6.20.0, 7.1.0
            Reporter: Roland Foerther


If you inject a field with SpringComponentInjector as class (instead of interface) and if wrapInProxies is set, the generated proxy is only cached if the proxy target in spring application context is a singleton. The corresponding code fragment  in AnnotProxyFieldValueFactory.getFieldValue(...) is

if (wrapInProxies)
{
   target = LazyInitProxyFactory.createProxy(field.getType(), locator);
}

// only put the proxy into the cache if the bean is a singleton
if (locator.isSingletonBean())
{
   Object tmpTarget = cache.putIfAbsent(locator, target);
   ...
}

The problem now is, each time you inject a none singleton spring bean (prototype or other scope) by class, LazyInitProxyFactory.createProxy(...) creates  a new proxy class with help of CGLIB by deriving from the target class.
This will continuously eat up the permgen space, which was the case in our project.

Is it possible to create lazy init proxies for none singleton Spring beans that are cachable? This would resolve the problem.  




 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)