Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 56FAD200CBE for ; Fri, 23 Jun 2017 08:03:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 55AA5160BF1; Fri, 23 Jun 2017 06:03:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C1A4F160BE7 for ; Fri, 23 Jun 2017 08:03:09 +0200 (CEST) Received: (qmail 8344 invoked by uid 500); 23 Jun 2017 06:03:08 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 8333 invoked by uid 99); 23 Jun 2017 06:03:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2017 06:03:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7737ADFE8B; Fri, 23 Jun 2017 06:03:08 +0000 (UTC) From: franz1981 To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis issue #1361: ARTEMIS-1248 Reduce garbage while Paging Content-Type: text/plain Message-Id: <20170623060308.7737ADFE8B@git1-us-west.apache.org> Date: Fri, 23 Jun 2017 06:03:08 +0000 (UTC) archived-at: Fri, 23 Jun 2017 06:03:10 -0000 Github user franz1981 commented on the issue: https://github.com/apache/activemq-artemis/pull/1361 @clebertsuconic There is no need to use a ThreadLocal or a pooled buffer there because: 1) the method (write/read) is synchronized and it is safe to reuse the same ByteBuf wrapper between different threads (note: is only a wrapper on the ByteBuffer provided by the file factory) 2) the file factory already provides a (thread local) pooled direct ByteBuffer (on NIO) In the old version the most of the garbage was already avoided due to the fileFactory ByteBuffer thread local pooling, but I've measured after multiple Page writes lots of minor GCs due to many short living ActiveMQBuffer instances. This change aims reduce that instances to be only 1 per Page: it is not optimal but is a big improvement. With 100 bytes messages and a Page of 10 MB it avoids about 104856 instances of garbage. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---