From hdfs-dev-return-32518-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Wed May 9 00:51:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2152E18063B for ; Wed, 9 May 2018 00:51:03 +0200 (CEST) Received: (qmail 47258 invoked by uid 500); 8 May 2018 22:51:02 -0000 Mailing-List: contact hdfs-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-dev@hadoop.apache.org Received: (qmail 46974 invoked by uid 99); 8 May 2018 22:51:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 May 2018 22:51:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1EE4ACB4CA for ; Tue, 8 May 2018 22:51:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id OLWMvPO79sIi for ; Tue, 8 May 2018 22:51:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0D4EB5FB94 for ; Tue, 8 May 2018 22:51:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4EAFAE0047 for ; Tue, 8 May 2018 22:51:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1580621298 for ; Tue, 8 May 2018 22:51:00 +0000 (UTC) Date: Tue, 8 May 2018 22:51:00 +0000 (UTC) From: "Xiao Chen (JIRA)" To: hdfs-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HDFS-13540) DFSStripedInputStream should not allocate new buffers during close / unbuffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Xiao Chen created HDFS-13540: -------------------------------- Summary: DFSStripedInputStream should not allocate new buffers during close / unbuffer Key: HDFS-13540 URL: https://issues.apache.org/jira/browse/HDFS-13540 Project: Hadoop HDFS Issue Type: Bug Affects Versions: 3.0.0 Reporter: Xiao Chen Assignee: Xiao Chen This was found in the same scenario where HDFS-13539 is caught. There are 2 OOM that looks interesting: {noformat} FSDataInputStream#close error: OutOfMemoryError: Direct buffer memoryjava.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Bits.java:694) at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123) at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311) at org.apache.hadoop.io.ElasticByteBufferPool.getBuffer(ElasticByteBufferPool.java:95) at org.apache.hadoop.hdfs.DFSStripedInputStream.resetCurStripeBuffer(DFSStripedInputStream.java:118) at org.apache.hadoop.hdfs.DFSStripedInputStream.closeCurrentBlockReaders(DFSStripedInputStream.java:205) at org.apache.hadoop.hdfs.DFSInputStream.close(DFSInputStream.java:672) at org.apache.hadoop.hdfs.DFSStripedInputStream.close(DFSStripedInputStream.java:181) at java.io.FilterInputStream.close(FilterInputStream.java:181) {noformat} and {noformat} org/apache/hadoop/fs/FSDataInputStream#unbuffer failed: error: OutOfMemoryError: Direct buffer memoryjava.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Bits.java:694) at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123) at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311) at org.apache.hadoop.io.ElasticByteBufferPool.getBuffer(ElasticByteBufferPool.java:95) at org.apache.hadoop.hdfs.DFSStripedInputStream.resetCurStripeBuffer(DFSStripedInputStream.java:118) at org.apache.hadoop.hdfs.DFSStripedInputStream.closeCurrentBlockReaders(DFSStripedInputStream.java:205) at org.apache.hadoop.hdfs.DFSInputStream.unbuffer(DFSInputStream.java:1782) at org.apache.hadoop.fs.StreamCapabilitiesPolicy.unbuffer(StreamCapabilitiesPolicy.java:48) at org.apache.hadoop.fs.FSDataInputStream.unbuffer(FSDataInputStream.java:230) {noformat} As the stack trace goes, {{resetCurStripeBuffer}} will get buffer from the buffer pool. We could save the cost of doing so if it's just a close or unbuffer call. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org