ted-ross commented on a change in pull request #711: Added debug-dump backtrace
for leaked objects in pooled memory.
URL: https://github.com/apache/qpid-dispatch/pull/711#discussion_r399406070
##########
File path: src/alloc_pool.c
##########
@@ -501,11 +537,25 @@ void qd_alloc_finalize(void)
// Check the stats for lost items
//
#if QD_MEMORY_STATS
- if (dump_file && desc->stats->total_free_to_heap <
desc->stats->total_alloc_from_heap)
+ if (dump_file && desc->stats->total_free_to_heap <
desc->stats->total_alloc_from_heap) {
fprintf(dump_file,
"alloc.c: Items of type '%s' remain allocated at shutdown:
%"PRId64"\n",
desc->type_name,
desc->stats->total_alloc_from_heap -
desc->stats->total_free_to_heap);
+#ifdef QD_MEMORY_DEBUG
+ qd_alloc_type_t *qtype = (qd_alloc_type_t*) desc->debug;
+ qd_alloc_item_t *item = DEQ_HEAD(qtype->allocated);
+ while (item) {
+ size_t i;
+ char **strings;
+ strings = backtrace_symbols (item->backtrace,
item->backtrace_size);
Review comment:
That would be good to know. I'll check that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]