[
https://issues.apache.org/jira/browse/HDFS-7276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14192373#comment-14192373
]
Colin Patrick McCabe commented on HDFS-7276:
--------------------------------------------
Looks better, thanks.
bq. ByteArrayManager is a generic class. So it may not necessarily be 12.
I agree that it may not necessarily be 12, but because it grows
logarithmically, it doesn't seem like a major concern. Even to support
gigabytes of storage, you only need 29 or 30 storage managers. Java uses
31-bit numbers to represent the length of arrays, so it can't even ever be more
than 31 - 3 = 28 or so. The extra complexity (and poor performance during
startup) needed to dynamically add managers doesn't seem worth it, in my
opinion.... am I missing something?
bq. Both the wait time out and the notifyAll are for preventing deadlock. After
some thought, only one of them is needed. I choose to keep notifyAll since the
timeout value is hard to determine.
Can you explain how a deadlock would occur if this were {{notify}} rather than
{{notifyAll}}? It seems like each time a notification occurs, either 0 or 1
waiters will wake up and start progressing. There is never a case where
someone calls {{wait}} but is not ready to run if {{numAllocated}} is
decreased. So I don't see how deadlock is a possibility. I don't see the
benefit in waking up additional threads... there is nothing useful they can do
and they consume CPU.
> 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
> 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
>
>
> 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)