From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, FORGED_HOTMAIL_RCVD2,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 4217520248 for ; Fri, 29 Mar 2019 04:31:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 1818D12093A; Fri, 29 Mar 2019 13:30:55 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3096C12126D for ; Fri, 29 Mar 2019 13:30:51 +0900 (JST) Received: by filter0173p3mdw1.sendgrid.net with SMTP id filter0173p3mdw1-6948-5C9D9F7B-19 2019-03-29 04:30:51.5674152 +0000 UTC m=+114313.533834327 Received: from herokuapp.com (unknown [54.197.0.128]) by ismtpd0039p1iad1.sendgrid.net (SG) with ESMTP id epuflRxkSoy-0_9_l4ipjw for ; Fri, 29 Mar 2019 04:30:51.532 +0000 (UTC) Date: Fri, 29 Mar 2019 04:30:51 +0000 (UTC) From: dennisb55@hotmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67532 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15667 X-Redmine-Issue-Author: sam.saffron X-Redmine-Sender: bluz71 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?WXKiZGyezrVw2qykZp9G6dps=2FB0nFwL2j6TcEa662=2FMhI45a91guRFYG1=2FmVug?= =?us-ascii?Q?ji2+UaVu8EzSyj83KSwlEt=2FpBkYWAvQlGdo1K9R?= =?us-ascii?Q?Xaffko6QvXqxs+sY5IidQ0QmR2IXbljNWhquNMR?= =?us-ascii?Q?mI63yTFSjCOF79FW6DCo2Uhwa97ZStDSaYiYXRK?= =?us-ascii?Q?2EcKDbz8V0Xy3MRfZ3CjWrOO3+vdyDSjGfA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92046 Subject: [ruby-core:92046] [Ruby trunk Feature#15667] Introduce malloc_trim(0) in full gc cycles X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15667 has been updated by bluz71 (Dennis B). Thanks Sam, a very nice set of results. Notice that 99th percentile Topic list was faster with the patch, whilst slower with Topic view. So I'm not sure we can say that the patch will always be slower on the worst runs. Query, what is the version of jemalloc that you are using? One of the interesting observations in [#14759](https://bugs.ruby-lang.org/issues/14759#note-6) is the variance between jemalloc versions (say 3.6.0 vs 5.1.0). ---------------------------------------- Feature #15667: Introduce malloc_trim(0) in full gc cycles https://bugs.ruby-lang.org/issues/15667#change-77367 * Author: sam.saffron (Sam Saffron) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Per Hongli's excellent article it looks like malloc_trim can help tremendously with memory bloat issues. https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming I would like to get this patch tested side-by-side at Discourse, GitHub and Shopify. If it looks good I think this is both a great candidate for 2.7 and and 2.4,2.5,2.6 backports. Will coordinate with Shopify and GitHub to see if we can get numbers posted here, I will run tests on a live Discourse instance over the next week and report numbers here. Koichi, what are your thoughts, to me this looks like an incredibly safe patch, the amount of work added to major GCs is tiny compared to the potential benefit, walking all pages is a very cheap operation. ---Files-------------------------------- ruby_gc_malloc_trim.patch (1011 Bytes) Screenshot_2019-03-28 Grafana - Compare Discourse Perf.png (530 KB) -- https://bugs.ruby-lang.org/