mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [ANN] mwrap 2.1.0 mwrap - LD_PRELOAD malloc wrapper for Ruby
@ 2018-08-11  4:31 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2018-08-11  4:31 UTC (permalink / raw)
  To: ruby-talk, mwrap-public


    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:

    And a live demo runs at:

    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


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:

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:
	nntp:// (no HTML mail, please)

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

git clone
homepage + rdoc:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-11  4:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-11  4:31 [ANN] mwrap 2.1.0 mwrap - LD_PRELOAD malloc wrapper for Ruby Eric Wong

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).