Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 687831877E for ; Thu, 4 Feb 2016 18:23:27 +0000 (UTC) Received: (qmail 85375 invoked by uid 500); 4 Feb 2016 18:23:27 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 85315 invoked by uid 500); 4 Feb 2016 18:23:27 -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 85303 invoked by uid 99); 4 Feb 2016 18:23:26 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 18:23:26 +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 8C9E918061F for ; Thu, 4 Feb 2016 18:23:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.256 X-Spam-Level: * X-Spam-Status: No, score=1.256 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URI_HEX=1.313, URI_TRY_3LD=0.064] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id lByQ5BWy8_nj for ; Thu, 4 Feb 2016 18:23:24 +0000 (UTC) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.170]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 327B820468 for ; Thu, 4 Feb 2016 18:23:24 +0000 (UTC) Received: by mail-yw0-f170.google.com with SMTP id g127so31843227ywf.2 for ; Thu, 04 Feb 2016 10:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=54xC+BY7fGC89d7sq9TNWhcH64y+vWjhw5AR0Tbhv7I=; b=oqexb7QZf66e+AUjChm1ZobUNZxV8BCAj4A4S2zpRUcF4qvuymsiH0rJwu53TFwk4S IFB9/h0VG39y5V8t46R/mZjKnJ5AEZBhcMIXPrUeDevECIWBsPybEMHiB5v/Gj4zE4Y0 rzvN42D0tHBSszQ+xFSi7VNny9iWaE+04e9+4Wt+lJC19IaS0m/qhHwCK52DheDha/SW QFuLX9Hs4VNjGN9seYZQSEFDnfpCKdzTzAEquHaFN8Ab5RBi3BWfvmij7xeMHHv9HqyI 8Fd6NElRa8OkR60WGT1pmIpgyaCY7sU1asHdy/QwAUlK40MIEnoqW1BGweVC52R/yRpS H+oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=54xC+BY7fGC89d7sq9TNWhcH64y+vWjhw5AR0Tbhv7I=; b=cTcdw+JZ6p8SdrKdD6iG8/5L1HnEcSEPQs6y0r9+RWVKhR+5R1Pm/+UA+un2Fv2xgL VW23Rvw3y90NZgwavwYIvNi9EbMp+Eu8KCpuOZbdQdZVYx5+r3H1SH5c+xUYOQrn4d1d PY09XD8pGr58khxSfE1KuWOA8UuUdBtBsOR++6aoJmHp0DbwsnhM424FGtwrF8sTZvPX 1Rtfggvrgxs/7lcy1KyKFY7RqxP13OUUXZ3pBvmxZnWQqkOQj8F2CXyrXj83u7cNLqaK 9f/h96OWD9xqhoKQa2usYvoIvxy1G/6eG27l1ZQy1LaxZgwUKSsbrAvxK/3L1jVj7Vv3 zCbw== X-Gm-Message-State: AG10YORYCvHPSRUSSg7aCg4mvGE3++6djD+yk5T+5xGWR49a/IU6n3GVFWp1r6WFSFzRbtbdSOpzFyNnqkd1AA== MIME-Version: 1.0 X-Received: by 10.129.54.16 with SMTP id d16mr4454845ywa.41.1454610203427; Thu, 04 Feb 2016 10:23:23 -0800 (PST) Received: by 10.37.6.215 with HTTP; Thu, 4 Feb 2016 10:23:23 -0800 (PST) In-Reply-To: <1454603365259-4706961.post@n4.nabble.com> References: <1454603365259-4706961.post@n4.nabble.com> Date: Thu, 4 Feb 2016 13:23:23 -0500 Message-ID: Subject: Re: Artemis use of PhantomReference impacting GC performance From: Clebert Suconic To: "dev@activemq.apache.org" Content-Type: text/plain; charset=UTF-8 This discussion is probably a better fit on a Wildfly user's forum. also I don't think measuring Milliseconds times taken on GC are a good measure. You need to provide something more concrete such as.. .latency has increased... throughput degrated.. etc.. etc... Netty Probably uses some PhantonReferences to control reused pools. We have recently improved that reuse and we are always going beyond the basics. also: XNIO is a JBoss Project, so I don't know much about XNIO. (even if I did this forums wouldn't be a fit place for this discussion). On Thu, Feb 4, 2016 at 11:29 AM, jim_b_o wrote: > I have observed a significant degradation in GC performance after upgrading > from JBoss 4.2.3.GA to WildFly 10.0.0.Final. I'm 99% sure the difference is > due to Artemis ActiveMQ making heavy use of PhantomReference objects > (directly or indirectly). I'm raising this discussion to see if anyone else > can observe the same behaviour and determine whether to raise an issue > against Artemis or one of its dependencies. > > What's changed? > > > I have JBoss 4.2.3.GA (with jboss-messaging-1.4.5.GA) and WildFly > 10.0.0.Final running on identical hardware with identical JVMs (8u71) and GC > settings (using G1GC). The application is only minimally changed as > required by the API differences between the old and new servers. The > application load is identical and results in near identical memory > allocation rate and young GC frequency. > > *The difference is that on JBoss each young GC takes around 10-12ms whereas > on WildFly they take 16-20ms.* The additional time is taken in the Object > Copy and Ref Proc phases. This indicates that there are more Survivor > objects on each GC and more References being processed. I'm pretty sure the > additional Survivor objects are also the Reference objects. Running a Java > Mission Control (JMC) Flight Recording on these two systems under identical > production load, WildFly is showing around 11,000 PhantomReferences > processed each GC versus a handful on JBoss. The number of > PhantomReferences seems to approximately correspond to the number of JMS > messages transmitted between GCs. > > Some evidence > > > In a separate test environment I have WildFly running under a standard test > load. It is emitting JMS messages at a consistent rate (lower than > production) onto a non-durable Topic. The following image shows a 2 minute > JMC recording when there is no subscriber on the Topic. We can see that > there are very few PhantomReferences and the GCs take around 4ms. > > > > However once I start up an external JMS client subscribed to the Topic the > PhantomReferences appear and the GCs slow down as shown in the next image. > The messaging is non-XA with auto-ack. > > > > Where do the PhantomReferences come from? > > > I used the debugger to capture where the PhantomReferences are being > created. This seems to indicate they are generated by Artemis and/or the > associated XNIO remoting... > > Thread [Thread-1 > (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$2@788d198e-832298282)] > (Suspended (breakpoint at line 80 in PhantomReference)) > Cleaner(PhantomReference).(T, ReferenceQueue) line: 80 > Cleaner.(Object, Runnable) line: 115 > Cleaner.create(Object, Runnable) line: 133 > DirectByteBuffer.(int) line: 139 > ByteBuffer.allocateDirect(int) line: 311 > UnpooledUnsafeDirectByteBuf.allocateDirect(int) line: 108 > UnpooledUnsafeDirectByteBuf.(ByteBufAllocator, int, int) line: 69 > UnpooledByteBufAllocator.newDirectBuffer(int, int) line: 50 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int, int) > line: 155 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int) line: > 146 > NettyServerConnection.createTransportBuffer(int) line: 38 > > RemotingConnectionImpl(AbstractRemotingConnection).createTransportBuffer(int) > line: 162 > SessionReceiveMessage.encode(RemotingConnection) line: 59 > ChannelImpl.send(Packet, boolean, boolean) line: 225 > ChannelImpl.sendBatched(Packet) line: 205 > CoreSessionCallback.sendMessage(ServerMessage, ServerConsumer, int) line: > 84 > ServerConsumerImpl.deliverStandardMessage(MessageReference, ServerMessage) > line: 883 > ServerConsumerImpl.proceedDeliver(MessageReference) line: 366 > QueueImpl.proceedDeliver(Consumer, MessageReference) line: 2358 > QueueImpl.deliver() line: 1873 > QueueImpl.access$1400(QueueImpl) line: 97 > QueueImpl$DeliverRunner.run() line: 2581 > OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run() line: 100 > ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1142 > ThreadPoolExecutor$Worker.run() line: 617 > Thread.run() line: 745 > Thread [default I/O-5] (Suspended (breakpoint at line 80 in > PhantomReference)) > Cleaner(PhantomReference).(T, ReferenceQueue) line: 80 > Cleaner.(Object, Runnable) line: 115 > Cleaner.create(Object, Runnable) line: 133 > DirectByteBuffer.(int) line: 139 > ByteBuffer.allocateDirect(int) line: 311 > UnpooledUnsafeDirectByteBuf.allocateDirect(int) line: 108 > UnpooledUnsafeDirectByteBuf.(ByteBufAllocator, int, int) line: 69 > UnpooledByteBufAllocator.newDirectBuffer(int, int) line: 50 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int, int) > line: 155 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int) line: > 146 > UnpooledByteBufAllocator(AbstractByteBufAllocator).ioBuffer(int) line: 107 > AdaptiveRecvByteBufAllocator$HandleImpl.allocate(ByteBufAllocator) line: > 104 > > AbstractXnioSocketChannel$ReadListener.handleEvent(ConduitStreamSourceChannel) > line: 426 > AbstractXnioSocketChannel$ReadListener.handleEvent(Channel) line: 371 > ChannelListeners.invokeChannelListener(T, ChannelListener) line: > 92 > ReadReadyHandler$ChannelListenerHandler.readReady() line: 66 > NioSocketConduit.handleReady(int) line: 88 > WorkerThread.run() line: 559 > Thread [default I/O-4] (Suspended (breakpoint at line 80 in > PhantomReference)) > Cleaner(PhantomReference).(T, ReferenceQueue) line: 80 > Cleaner.(Object, Runnable) line: 115 > Cleaner.create(Object, Runnable) line: 133 > DirectByteBuffer.(int) line: 139 > ByteBuffer.allocateDirect(int) line: 311 > UnpooledUnsafeDirectByteBuf.allocateDirect(int) line: 108 > UnpooledUnsafeDirectByteBuf.(ByteBufAllocator, int, int) line: 69 > UnpooledByteBufAllocator.newDirectBuffer(int, int) line: 50 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int, int) > line: 155 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int) line: > 146 > UnpooledByteBufAllocator(AbstractByteBufAllocator).ioBuffer(int) line: 107 > AdaptiveRecvByteBufAllocator$HandleImpl.allocate(ByteBufAllocator) line: > 104 > > AbstractXnioSocketChannel$ReadListener.handleEvent(ConduitStreamSourceChannel) > line: 426 > AbstractXnioSocketChannel$ReadListener.handleEvent(Channel) line: 371 > ChannelListeners.invokeChannelListener(T, ChannelListener) line: > 92 > ReadReadyHandler$ChannelListenerHandler.readReady() line: 66 > NioSocketConduit.handleReady(int) line: 88 > WorkerThread.run() line: 559 > Thread [default I/O-2] (Suspended (breakpoint at line 80 in > PhantomReference)) > Cleaner(PhantomReference).(T, ReferenceQueue) line: 80 > Cleaner.(Object, Runnable) line: 115 > Cleaner.create(Object, Runnable) line: 133 > DirectByteBuffer.(int) line: 139 > ByteBuffer.allocateDirect(int) line: 311 > UnpooledUnsafeDirectByteBuf.allocateDirect(int) line: 108 > UnpooledUnsafeDirectByteBuf.(ByteBufAllocator, int, int) line: 69 > UnpooledByteBufAllocator.newDirectBuffer(int, int) line: 50 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int, int) > line: 155 > UnpooledByteBufAllocator(AbstractByteBufAllocator).directBuffer(int) line: > 146 > UnpooledByteBufAllocator(AbstractByteBufAllocator).ioBuffer(int) line: 107 > AdaptiveRecvByteBufAllocator$HandleImpl.allocate(ByteBufAllocator) line: > 104 > > AbstractXnioSocketChannel$ReadListener.handleEvent(ConduitStreamSourceChannel) > line: 426 > AbstractXnioSocketChannel$ReadListener.handleEvent(Channel) line: 371 > ChannelListeners.invokeChannelListener(T, ChannelListener) line: > 92 > ReadReadyHandler$ChannelListenerHandler.readReady() line: 66 > NioSocketConduit.handleReady(int) line: 88 > WorkerThread.run() line: 559 > > What's next? > > > So it's seems pretty certain that this is where the change is coming from. > The total GC load is still low but we're aiming for consistent low latency > and this is a backwards step. > > I'd be interested in any comments or questions. I can provide more info if > required. > > Thanks. > > > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-use-of-PhantomReference-impacting-GC-performance-tp4706961.html > Sent from the ActiveMQ - Dev mailing list archive at Nabble.com. -- Clebert Suconic