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

Timothy Ward edited comment on ARIES-1604 at 9/7/16 1:20 PM:
-------------------------------------------------------------

{quote}I thought the same when I saw the implementation but they're not 
unfortunately. Anyway, you're right I think. It could be more efficient to 
reuse the same executor instance for the promises.{quote}

I've checked this, and because Executors.newSingleThreadExecutor() is used then 
the Thread *will* be stopped when the Promise is garbage collected. The problem 
will show up when the Promise creation rate it too high, which should be much 
less of a problem in the latest snapshot.

The snapshot versions of promise.api, async.impl and async are now 
1.1.0-SNAPSHOT due to the change in API.


was (Author: timothyjward):
> I thought the same when I saw the implementation but they're not 
> unfortunately. Anyway, you're right I think. It could be more efficient to 
> reuse the same executor instance for the promises.

I've checked this, and because Executors.newSingleThreadExecutor() is used then 
the Thread *will* be stopped when the Promise is garbage collected. The problem 
will show up when the Promise creation rate it too high, which should be much 
less of a problem in the latest snapshot.

The snapshot versions of promise.api, async.impl and async are now 
1.1.0-SNAPSHOT due to the change in API.

> Aries async Thread leak
> -----------------------
>
>                 Key: ARIES-1604
>                 URL: https://issues.apache.org/jira/browse/ARIES-1604
>             Project: Aries
>          Issue Type: Bug
>    Affects Versions: async-1.0.2
>            Reporter: Paul Thevenot
>             Fix For: async-1.1.0
>
>
> The async service with repeated tasks leads to an OutOfMemoryError because 
> too many threads are created and we achieve the maximum number of threads of 
> the host (unable to create new native thread). 
> The leak seems to come from the PromiseImpl. For each Promise instantiated, 
> we do create a new SingleThreadExecutor.



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

Reply via email to