[
https://issues.apache.org/jira/browse/BROOKLYN-528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aled Sage resolved BROOKLYN-528.
--------------------------------
Resolution: Fixed
Fix Version/s: 0.12.0
> Memory leak: proxy class (and java.lang.reflect.* instances) per entity
> -----------------------------------------------------------------------
>
> Key: BROOKLYN-528
> URL: https://issues.apache.org/jira/browse/BROOKLYN-528
> Project: Brooklyn
> Issue Type: Bug
> Affects Versions: 0.11.0
> Reporter: Aled Sage
> Assignee: Aled Sage
> Fix For: 0.12.0
>
>
> There is a memory leak when creating and deleting entities.
> After creating and then deleting a really simple app many times, there are a
> lot of classes with names like {{class com.sun.proxy.$Proxy10033}} (probably
> one per entity we created!). This also leads to a huge number of instances of
> things like {{java.lang.reflect.Method}}.
> e.g. deploy and delete the app:
> {noformat}
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}
> ---
> Looking at the code in
> {{org.apache.brooklyn.core.objs.proxy.InternalEntityFactory.createEntityProxy()}},
> when it calls {{java.lang.reflect.Proxy.newProxyInstance}} it first creates
> a new {{AggregateClassLoader}} instance and passes that in. This causes
> {{newProxyInstance}} to create a new class every time.
> The fix should be simple: to reuse {{AggregateClassLoader}} instances, rather
> than creating new ones.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)