[ 
https://issues.apache.org/jira/browse/OLINGO-754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14934648#comment-14934648
 ] 

Michael Bolz commented on OLINGO-754:
-------------------------------------

Hi [~manuel_b],

currently I have nothing heard about memory leak by others.
Perhaps this issue occurs only in combination with specific application servers 
(and based on Thread handling of them).
I know about use of Olingo in combination with {{Virgo}}, {{Apache Felix}} and 
{{Tomcat}} where no memory leaks are detected.
But IMHO the use of {{ThreadLocal}} should be avoided and is a *technical 
debt/bad smell* in each code.
The idea of {{setUp}} and/or {{tearDown}} methods is good, however in this case 
it could be better to check if the use of the {{ThreadLocal}} could be avoided.

Best Regards,
Michael

> MemoryLeak when using Olingo in Wildfly
> ---------------------------------------
>
>                 Key: OLINGO-754
>                 URL: https://issues.apache.org/jira/browse/OLINGO-754
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.4
>         Environment: java 8, wildfly 8.2, Linux
>            Reporter: Manuel Blechschmidt
>
> The following code produces a memory leak in an application server:
> {code:title=org.apache.olingo.odata2.jpa.processor.core.ODataJPAContextImpl}
>   @Override
>   public void setODataContext(final ODataContext ctx) {
>     odataContext = ctx;
>     // This produces a memory leak on wildfly
>     setContextInThreadLocal(odataContext);
>   }
> {code}
> I removed the setContextInThreadLocal and it worked afterwards. I searched 
> the whole code how this variable is normaly removed but was not able to find 
> the clean way to solve this problem.



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

Reply via email to