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

Colin Patrick McCabe commented on HDFS-7276:
--------------------------------------------

Re: deadlock discussion.

It's correct that the code would deadlock without {{notifyAll}} in its current 
form.  However, a simple fix would prevent this: the releasing code could 
simply call {{notify}} whenever count < limit, instead of only calling it when 
count == limit.  This would prevent the "thundering herd" problem that the code 
currently has.  See http://en.wikipedia.org/wiki/Thundering_herd_problem.  I 
filed HDFS-7325 as a follow-up to fix this.

> Limit the number of byte arrays used by DFSOutputStream
> -------------------------------------------------------
>
>                 Key: HDFS-7276
>                 URL: https://issues.apache.org/jira/browse/HDFS-7276
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs-client
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>             Fix For: 2.6.0
>
>         Attachments: h7276_20141021.patch, h7276_20141022.patch, 
> h7276_20141023.patch, h7276_20141024.patch, h7276_20141027.patch, 
> h7276_20141027b.patch, h7276_20141028.patch, h7276_20141029.patch, 
> h7276_20141029b.patch, h7276_20141030.patch, h7276_20141031.patch
>
>
> When there are a lot of DFSOutputStream's writing concurrently, the number of 
> outstanding packets could be large.  The byte arrays created by those packets 
> could occupy a lot of memory.



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

Reply via email to