From 573a5abd9d6b1668b49376b489b187780c7125c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Tue, 27 Mar 2018 13:14:40 +0200 Subject: erts: Rewrite memory instrumentation This commit replaces the old memory instrumentation with a new implementation that scans carriers instead of wrapping erts_alloc/erts_free. The old implementation could not extract information without halting the emulator, had considerable runtime overhead, and the memory maps it produced were noisy and lacked critical information. Since the new implementation walks through existing data structures there's no longer a need to start the emulator with special flags to get information about carrier utilization/fragmentation. Memory fragmentation is also easier to diagnose as it's presented on a per-carrier basis which eliminates the need to account for "holes" between mmap segments. To help track allocations, each allocation can now be tagged with what it is and who allocated it at the cost of one extra word per allocation. This is controlled on a per-allocator basis with the +Matags option, and is enabled by default for binary_alloc and driver_alloc (which is also used by NIFs). --- erts/doc/src/erts_alloc.xml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'erts/doc/src') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 53e136d76c..0893eb291c 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -559,6 +559,20 @@ than this threshold, otherwise the carrier is shrunk. See also rsbcst.

+ atags true|false]]> + +

Adds a small tag to each allocated block that contains basic + information about what it is and who allocated it. Use the + instrument + module to inspect this information.

+ +

The runtime overhead is one word per allocation when enabled. This + may change at any time in the future.

+ +

The default is true for binary_alloc and + driver_alloc, and false for the other allocator + types.

+
e true|false]]>

Enables allocator ]]>.

@@ -724,22 +738,12 @@
Instrumentation Flags - +Mim true|false - -

A map over current allocations is kept by the emulator. - The allocation map can be retrieved through module - - instrument(3). +Mim true - implies +Mis true. +Mim true is the same as flag - -instr in - erl(1).

-
- +Mis true|false - -

Status over allocated memory is kept by the emulator. - The allocation status can be retrieved through module - - instrument(3).

+ +M<S>atags + +

Adds a small tag to each allocated block that contains basic + information about what it is and who allocated it. See + +M<S>atags for a + more complete description.

+Mit X -- cgit v1.2.3