steveloughran commented on a change in pull request #3499:
URL: https://github.com/apache/hadoop/pull/3499#discussion_r783308972



##########
File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInputStream.java
##########
@@ -955,11 +955,27 @@ private void populateBuffer(int length,
                               S3ObjectInputStream objectContent) throws 
IOException {
     if (buffer.isDirect()) {
       byte[] tmp = new byte[length];
-      objectContent.read(tmp, 0, length);
+      readByteArray(objectContent, tmp, 0, length);

Review comment:
       maybe we should create a buffer of a max size, read in blocks and put 
incrementally. otherwise we alloc a 1GB array to load a range that big, when we 
don't need so much heap




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to