[ 
https://issues.apache.org/jira/browse/OPENEJB-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Gumbrecht resolved OPENEJB-1265.
-------------------------------------

       Resolution: Implemented
    Fix Version/s: (trunk/openejb)

Access to the ByteArrayOutputStream is synchronized and can simply be reset.
                
> TempClassLoader buffer reuse reduces memory requirements
> --------------------------------------------------------
>
>                 Key: OPENEJB-1265
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1265
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.1.x
>         Environment: All
>            Reporter: Andy Gumbrecht
>            Priority: Trivial
>              Labels: OpenEJB, TempClassLoader
>             Fix For: (trunk/openejb)
>
>         Attachments: TempClassLoader.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The current TempClassLoader potentially uses a new 8k ByteArrayOutputStream 
> per class that it inspects. 
> Whilst hunting for a possible ClassLoader issue I  found that replacing the 
> ByteArrayOutputStream with a reusable one leads to a substantial reduction in 
> memory during server start up.
> I am unable to quantify what 'substantial' means in real terms as I have not 
> run any real benchmarking, but it is fair to say that I had noticed heap 
> sizes growing to over 180m during a server start compared to the 90m that I 
> have now. These values would be application specific, but it would be nice to 
> see if this is an improvement for others.
> I have also synchronized a few access methods to ensure that resources are 
> protected during the inspection process.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to