summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-12-08 08:41:13 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-12-08 14:40:31 +0000
commitaae8eaa8104197652d487042a66fddd850da72f3 (patch)
treeec402ae6854f2bf4d5ab9b91a47644d9df592ffc /doc
parent7359ecec6a8919a15dc1ce3bef3ab99d0898414f (diff)
core/memacct: save allocs in mem_acct_rec list
With configure --enable-debug, add all object allocations to a list in the corresponding mem_acct_rec. This allows us to see all objects of a particular type and allows for additional debugging in case of memory leaks. This is not compiled in by default and must be explicitly enabled. It is intended to be used by developers. > Change-Id: I7cf2dbeadecf994423d7e7591e85f18d2575cce8 > BUG: 1522662 > Signed-off-by: N Balachandran <nbalacha@redhat.com> (cherry picked from commit 47d01546a1826dc14a8331ea8700015f1cfdc4db) Change-Id: I7cf2dbeadecf994423d7e7591e85f18d2575cce8 BUG: 1523455 Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/debugging/mem-alloc-list.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/debugging/mem-alloc-list.md b/doc/debugging/mem-alloc-list.md
new file mode 100644
index 00000000000..1c68e65d323
--- /dev/null
+++ b/doc/debugging/mem-alloc-list.md
@@ -0,0 +1,19 @@
+## Viewing Memory Allocations
+
+While statedumps provide stats of the number of allocations, size etc for a
+particular mem type, there is no easy way to examine all the allocated objects of that type
+in memory.Being able to view this information could help with determining how an object is used,
+and if there are any memory leaks.
+
+The mem_acct_rec structures have been updated to include lists to which the allocated object is
+added. These can be examined in gdb using simple scripts.
+
+`gdb> plist xl->mem_acct.rec[$type]->obj_list`
+
+will print out the pointers of all allocations of $type.
+
+These changes are primarily targeted at developers and need to enabled
+at compile-time using `configure --enable-debug`.
+
+
+