aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-04-26 15:19:56 +0200
committerLukas Larsson <[email protected]>2016-04-26 15:36:41 +0200
commitd0bca6c9aceb6b5be35342387d6bbbf0f3c5244c (patch)
treeb0885f5d37d58bf59fb15384a10b39d51b72cd5b /erts/emulator/beam/erl_gc.c
parent6aae129123c4ce8988cc67b3545db9d1ec51324b (diff)
downloadotp-d0bca6c9aceb6b5be35342387d6bbbf0f3c5244c.tar.gz
otp-d0bca6c9aceb6b5be35342387d6bbbf0f3c5244c.tar.bz2
otp-d0bca6c9aceb6b5be35342387d6bbbf0f3c5244c.zip
erts: Fix total_heap_size calculation for on_heap
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r--erts/emulator/beam/erl_gc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 4698458521..881876ba59 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -3006,10 +3006,30 @@ erts_process_gc_info(Process *p, Uint *sizep, Eterm **hpp)
};
Eterm res = THE_NON_VALUE;
+ ErtsMessage *mp;
ERTS_CT_ASSERT(sizeof(values)/sizeof(*values) == sizeof(tags)/sizeof(*tags));
ERTS_CT_ASSERT(sizeof(values)/sizeof(*values) == ERTS_PROCESS_GC_INFO_MAX_TERMS);
+ if (p->abandoned_heap) {
+ Eterm *htop, *heap;
+ ERTS_GET_ORIG_HEAP(p, heap, htop);
+ values[3] = HIGH_WATER(p) - heap;
+ values[6] = htop - heap;
+ }
+
+ if (p->flags & F_ON_HEAP_MSGQ) {
+ /* If on heap messages in the internal queue are counted
+ as being part of the heap, so we have to add them to the
+ am_mbuf_size value. process_info(total_heap_size) should
+ be the same as adding old_heap_block_size + heap_block_size
+ + mbuf_size.
+ */
+ for (mp = p->msg.first; mp; mp = mp->next)
+ if (mp->data.attached)
+ values[2] += erts_msg_attached_data_size(mp);
+ }
+
res = erts_bld_atom_uword_2tup_list(hpp,
sizep,
sizeof(values)/sizeof(*values),