From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C142A1F516 for ; Tue, 3 Jul 2018 00:11:23 +0000 (UTC) Received: by mail-oi0-x231.google.com with SMTP id s198-v6so318877oih.11 for ; Mon, 02 Jul 2018 17:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bBdUSKfcwoTXxGGtdhYisGUu92sA/VVk2V/MkIyIK24=; b=ocEyq1MKCjzWeBCo2J87y7nUR7BRlQ6mExE5DkJibjNFqd4HEX9q43KaZwfj/yGt/1 ePYHYepxH7wFkbTZ17kLCZXWtPgFFJCPicJhqqF0XM1xvMxfs8uS36GVI6qO3rmUZ1ar tyWhmm88FLIBr4nwWnRM4Pp8PRxlDiN+lMVBvnz/y/vhwaL7ss/ZHq0QqI/QilnkmFV8 PlzBUzVBfl3q48Snvzjwo8/kIe8uIOz4oybhtEjHiNBMFeKnLbCTVTeG9fgJup9XVNHy o47SOjAn8WEjtn6dHGtoj9ssGOhnxj5UdnVBp9A/D7aEQZ18zAwmIiDr4sDD55LHbUEU Ay3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bBdUSKfcwoTXxGGtdhYisGUu92sA/VVk2V/MkIyIK24=; b=FPZr13givqld+JqjZbSZRze2fkuIusIZPcygwWFck+K6i+HdCzbOWbMkQp+YRwuZqt 0VEJSA9oGVJbSFX1IHebMb0XChHr7bENpQNxtDw6rUA8jvp+MAiUna+ulqMk/dSmZaFd QVvlKdUVxZkC7PI5e8Uc9sIHEc1mskjtAKyF2lhfDma4D17mIFfa/PSJxZFIT0PGfy2f Ls2xj0LHA/6d9T8xkXcJj8Tk2sXgtbNFo49nLgGvTrNmR/emyQfww0/2ZOiVjqp0cyoK F3OkL1d1GXr4C5tqvRo91Euvh3yurEVVnGZjGHsqhQQIuewRmExtysThjE1Mx4zGWasj WUug== X-Gm-Message-State: APt69E1I6RzX9G/N13Apn6A0OFD719JFscL3T8uG1+yngz+yas2xHjQI dh3tHZPcbnJFq5Wdc3/yl2aFMYoWs+vXvLwsEOfHRLzI X-Google-Smtp-Source: AAOMgpdO0i0VkJh9anbx0Rlt6LTMRheu/HB/U1eDsxVWRc8p2GsxqpKRR+rWY0vhCwZlpOhY4GY45xMhD8UXHZisYrA= X-Received: by 2002:aca:f244:: with SMTP id q65-v6mr6837708oih.268.1530576682428; Mon, 02 Jul 2018 17:11:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:37d2:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 17:11:21 -0700 (PDT) In-Reply-To: <20180702120050.GA24029@dcvr> References: <20180702120050.GA24029@dcvr> From: Sam Saffron Date: Tue, 3 Jul 2018 10:11:21 +1000 Message-ID: Subject: Re: [ANN] mwrap - LD_PRELOAD malloc wrapper + line stats for Ruby To: Ruby users Cc: mwrap-public@80x24.org Content-Type: text/plain; charset="UTF-8" List-Id: Awesome Eric! I just ran this on a simple "Discourse boot" and got: https://gist.githubusercontent.com/SamSaffron/220910a8fb7abd1226c3e9eb0c447ef4/raw/53af7bb83c4ebe58e51b0cee862048b2e47995ad/sorted.txt It is fascinating to see absolute complete accounting with lines like: 301056 147 /usr/lib/x86_64-linux-gnu/libpq.so.5(+0x1324a) [0x7efd84d3824a] This is information that is hidden from `ObjectSpace#trace_object_allocations`. Complete accounting opens up a whole bunch of possibilities, we could for example compare with Ruby accounting and find memory that is not being reported to Ruby properly. Is there any chance we can have a mode with "free" tracking as well? That way we can enable this on a long running process to detect leaks? It also makes c level leaks way easier to debug, cause we can listen on a signal and dump a log on it. Then comparing 2 logs can give us a leak very very easily. (we could add mwrap --compare dump1 dump2 to ease this usage) Also per: 344809221 1070570 /home/sam/.rbenv/versions/master/lib/ruby/gems/2.6.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283 39139224 26553 /home/sam/.rbenv/versions/master/lib/ruby/gems/2.6.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277 I wonder if there is any way we can get slightly better reporting here, I am guessing this is just around loading of code, but I wonder if we could break that down in a cleaner way here?