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

Kellen Sunderland commented on JOSHUA-306:
------------------------------------------

Hey Matt, +1.  It makes sense to me to remove items from the list after they've 
been iterated over.  Another idea would be to use a Queue or BlockingQueue as 
the backing data structure in the Translations (now TranslationResponseStream) 
class.

> Translations.java consumes potentially infinite resources
> ---------------------------------------------------------
>
>                 Key: JOSHUA-306
>                 URL: https://issues.apache.org/jira/browse/JOSHUA-306
>             Project: Joshua
>          Issue Type: Bug
>            Reporter: Matt Post
>             Fix For: 6.2
>
>
> Translations is used to asynchronously provide a caller with access to 
> translations as they are produced. However, it is implemented as an 
> underlying synchronized list that grows and grows. In the presence of an 
> infinite stream (STDIN?), this will eventually consume all resources. This 
> might not be much to worry about, but maybe we should have old translations 
> be expunged as they are consumed.



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

Reply via email to