Skip to content

GC improvement: Reduce string objects from Publisher and Consumer stats#1480

Merged
rdhabalia merged 1 commit into
apache:masterfrom
rdhabalia:ws_npe
Apr 4, 2018
Merged

GC improvement: Reduce string objects from Publisher and Consumer stats#1480
rdhabalia merged 1 commit into
apache:masterfrom
rdhabalia:ws_npe

Conversation

@rdhabalia

@rdhabalia rdhabalia commented Mar 30, 2018

Copy link
Copy Markdown
Contributor

Motivation

We have seen large young GC-pause in broker in specific states. Below is one of the example where broker's young gc reached to 1 sec and after capturing heap-dump it shows large number of string and char[] objects allocated by the producer/consumer stats of the topic and .

Young GC > 1.2 sec
snip20180330_24

Highest object allocation classes: String, char[]

snip20180327_19

Modifications

Producer/Consumer stats stores 4 String objects (address, producerName, connectedSince, version) which don't get modified once they are set. So, reducing 4 strings and char[] to 1 and store offsets of stats-placeholder which will reduce number of string and char[] objects.

Result

It will help to reduce GC when broker is serving many topics.
I am going to make some more GC enhancement in separate PR.

@rdhabalia rdhabalia added this to the 2.0.0-incubating milestone Mar 30, 2018
@rdhabalia rdhabalia self-assigned this Mar 30, 2018
@rdhabalia rdhabalia requested review from merlimat and saandrews April 3, 2018 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants