aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_monitors.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-05-13 16:24:33 +0200
committerLukas Larsson <[email protected]>2013-05-13 16:45:41 +0200
commit9116b4b6a19e18c926d218b325dfa6ddd4e04f41 (patch)
tree26207a5a35f69a78dc281f2eed863cb477423dc3 /erts/emulator/beam/erl_monitors.c
parent89939207898fc68a2ee0c080e603aa65fb866b25 (diff)
downloadotp-9116b4b6a19e18c926d218b325dfa6ddd4e04f41.tar.gz
otp-9116b4b6a19e18c926d218b325dfa6ddd4e04f41.tar.bz2
otp-9116b4b6a19e18c926d218b325dfa6ddd4e04f41.zip
Print process memory usage info in crash dump
Diffstat (limited to 'erts/emulator/beam/erl_monitors.c')
-rw-r--r--erts/emulator/beam/erl_monitors.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_monitors.c b/erts/emulator/beam/erl_monitors.c
index 70e592cc5f..244a2b26db 100644
--- a/erts/emulator/beam/erl_monitors.c
+++ b/erts/emulator/beam/erl_monitors.c
@@ -1024,3 +1024,23 @@ Eterm erts_debug_dump_links_1(BIF_ALIST_1)
}
}
}
+
+void erts_one_link_size(ErtsLink *lnk, void *vpu)
+{
+ Uint *pu = vpu;
+ *pu += ERTS_LINK_SIZE*sizeof(Uint);
+ if(!IS_CONST(lnk->pid))
+ *pu += NC_HEAP_SIZE(lnk->pid)*sizeof(Uint);
+ if (lnk->type != LINK_NODE && ERTS_LINK_ROOT(lnk) != NULL) {
+ erts_doforall_links(ERTS_LINK_ROOT(lnk),&erts_one_link_size,vpu);
+ }
+}
+void erts_one_mon_size(ErtsMonitor *mon, void *vpu)
+{
+ Uint *pu = vpu;
+ *pu += ERTS_MONITOR_SIZE*sizeof(Uint);
+ if(!IS_CONST(mon->pid))
+ *pu += NC_HEAP_SIZE(mon->pid)*sizeof(Uint);
+ if(!IS_CONST(mon->ref))
+ *pu += NC_HEAP_SIZE(mon->ref)*sizeof(Uint);
+}