mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
From: Eric Wong <e@80x24.org>
To: ruby-talk@ruby-lang.org, mwrap-public@80x24.org
Subject: [ANN] mwrap 2.1.0 mwrap - LD_PRELOAD malloc wrapper for Ruby
Date: Sat, 11 Aug 2018 04:31:06 +0000
Message-ID: <20180811043106.GA9571@dcvr> (raw)

Changes:

    mwrap 2.1.0 - heap_page_body struct tracking

    This release enables tracking of memalign allocations for
    "struct heap_page_body" in the Ruby GC.  This can be useful
    for tracking deathspans (time between free and re-allocation)
    of heap page bodies which can cause fragmentation in some
    malloc implementations, including glibc.

    The documentation for it is available at:

      https://80x24.org/mwrap/Mwrap/HeapPageBody.html

    And a live demo runs at:

      https://80x24.org/MWRAP/heap_pages

    This release also includes global counters for
     Mwrap.total_bytes_allocated and Mwrap.total_bytes_freed

    10 changes since v2.0.0 (2018-07-20):

          add olddoc.yml to generate links in page footers
          add .olddoc.yml to MANIFEST
          gemspec: use "git describe" output for prereleases
          add global counters for total bytes allocated/freed
          keep stats for memalign-ed heap_page_body in Ruby
          remove "memalign:" MWRAP option
          allow dump_heap: mask via MWRAP env
          tweak hpb stats destructor output
          struct acc: use 64-bit counters
          doc: 2.1 pre-release updates

About:

mwrap is designed to answer the question:

   Which lines of Ruby are hitting malloc the most?

mwrap wraps all malloc-family calls to trace the Ruby source
location of such calls and bytes allocated at each callsite.
As of mwrap 2.0.0, it can also function as a leak detector
and show live allocations at every call site.  Depending on
your application and workload, the overhead is roughly a 50%
increase memory and runtime.

It works best for allocations under GVL, but tries to track
numeric caller addresses for allocations made without GVL so you
can get an idea of how much memory usage certain extensions and
native libraries use.

It requires the concurrent lock-free hash table from the
Userspace RCU project: https://liburcu.org/

It does not require recompiling or rebuilding Ruby, but only
supports Ruby trunk (2.6.0dev+) on a few platforms:

* GNU/Linux
* FreeBSD (tested 11.1)

It may work on NetBSD, OpenBSD and DragonFly BSD.

Mailing list and archives:

	https://80x24.org/mwrap-public/
	nntp://80x24.org/inbox.comp.lang.ruby.mwrap
	mailto:mwrap-public@80x24.org (no HTML mail, please)

Note: I might not be able answer questions about this for a few days.

git clone https://80x24.org/mwrap.git
homepage + rdoc: https://80x24.org/mwrap/

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://80x24.org/mwrap/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180811043106.GA9571@dcvr \
    --to=e@80x24.org \
    --cc=mwrap-public@80x24.org \
    --cc=ruby-talk@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

mwrap user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://80x24.org/mwrap-public/0 mwrap-public/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 mwrap-public mwrap-public/ https://80x24.org/mwrap-public \
		mwrap-public@80x24.org
	public-inbox-index mwrap-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.mwrap
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.mwrap

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git