From issues-return-27743-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Tue Apr 24 06:41:07 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 9F109180671 for ; Tue, 24 Apr 2018 06:41:06 +0200 (CEST) Received: (qmail 26488 invoked by uid 500); 24 Apr 2018 04:41:05 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 26478 invoked by uid 99); 24 Apr 2018 04:41:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2018 04:41:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 89F561806CE for ; Tue, 24 Apr 2018 04:41:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id XBLJr34vJoxG for ; Tue, 24 Apr 2018 04:41:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 3F3B05F3BD for ; Tue, 24 Apr 2018 04:41:02 +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 215EDE0F1E for ; Tue, 24 Apr 2018 04:41:01 +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 60C7D241CE for ; Tue, 24 Apr 2018 04:41:00 +0000 (UTC) Date: Tue, 24 Apr 2018 04:41:00 +0000 (UTC) From: "Francesco Nigro (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ARTEMIS-1811) NIOSequentialFile should use RandomAccessFile with heap ByteBuffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ARTEMIS-1811?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Francesco Nigro updated ARTEMIS-1811: ------------------------------------- Description:=20 JournalStorageManager::addBytesToLargeMessage and=C2=A0LargeServerMessageIm= pl::DecodingContext::decode are=C2=A0relying on the pooling of direct ByteB= uffers performed internally by NIO. Those buffers are pooled until certain size limit (ie jdk.nio.maxCachedBuff= erSize, as shown on=C2=A0[https://bugs.openjdk.java.net/browse/JDK-8147468]= )=C2=A0and when not pooled are cleaned at the end of its usage. That's stress the native memory allocator and would lead to poor performanc= es and potential OOMs as well, dependently on the written message chunk siz= e. The proposed solutions are: # perform ad hoc direct ByteBuffer caching on the write path thanks to the= read lock # replace=C2=A0the NIO SequentialFile usage and just use RandomAccessFile = that provide the right API to append byte[] without creating additional nat= ive copies was: JournalStorageManager::addBytesToLargeMessage is relying on the pooling of = direct ByteBuffers performed internally by NIO. Those buffers are pooled until certain size limit (ie jdk.nio.maxCachedBuff= erSize, as shown on=C2=A0[https://bugs.openjdk.java.net/browse/JDK-8147468]= )=C2=A0and when not pooled are cleaned at the end of its usage. That's stress the native memory allocator and would lead to poor performanc= es and potential OOMs as well, dependently on the written message chunk siz= e. The proposed solutions are: # perform ad hoc direct ByteBuffer caching on the write path thanks to the= read lock # replace=C2=A0the NIO SequentialFile usage and just use RandomAccessFile = that provide the right API to append byte[] without creating additional nat= ive copies > NIOSequentialFile should use RandomAccessFile with heap ByteBuffers > ------------------------------------------------------------------- > > Key: ARTEMIS-1811 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1811 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: Broker > Affects Versions: 2.5.0 > Reporter: Francesco Nigro > Assignee: Francesco Nigro > Priority: Major > > JournalStorageManager::addBytesToLargeMessage and=C2=A0LargeServerMessage= Impl::DecodingContext::decode are=C2=A0relying on the pooling of direct Byt= eBuffers performed internally by NIO. > Those buffers are pooled until certain size limit (ie jdk.nio.maxCachedBu= fferSize, as shown on=C2=A0[https://bugs.openjdk.java.net/browse/JDK-814746= 8])=C2=A0and when not pooled are cleaned at the end of its usage. > That's stress the native memory allocator and would lead to poor performa= nces and potential OOMs as well, dependently on the written message chunk s= ize. > The proposed solutions are: > # perform ad hoc direct ByteBuffer caching on the write path thanks to t= he read lock > # replace=C2=A0the NIO SequentialFile usage and just use RandomAccessFil= e that provide the right API to append byte[] without creating additional n= ative copies -- This message was sent by Atlassian JIRA (v7.6.3#76005)