You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2020/03/27 15:43:43 UTC

[GitHub] [qpid-dispatch] ted-ross opened a new pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.

ted-ross opened a new pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.
URL: https://github.com/apache/qpid-dispatch/pull/711
 
 
   If QD_MEMORY_DEBUG is defined, this stores a backtrace for each allocated pool object so that objects left unfreed can be better described at shutdown.
   
   This is a fairly expensive feature.  We may want to consider providing an extra definable option so we can use QD_MEMORY_DEBUG without using this new feature.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ChugR commented on issue #711: Added debug-dump backtrace for leaked objects in pooled memory.

Posted by GitBox <gi...@apache.org>.
ChugR commented on issue #711: Added debug-dump backtrace for leaked objects in pooled memory.
URL: https://github.com/apache/qpid-dispatch/pull/711#issuecomment-605177820
 
 
   It would also be valuable to have a timestamp on the allocation. Then it could be correlated with the log file accurately.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.

Posted by GitBox <gi...@apache.org>.
kgiusti 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_r399404250
 
 

 ##########
 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:
   IIUC *strings needs to be freed manually

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ganeshmurthy commented on issue #711: Added debug-dump backtrace for leaked objects in pooled memory.

Posted by GitBox <gi...@apache.org>.
ganeshmurthy commented on issue #711: Added debug-dump backtrace for leaked objects in pooled memory.
URL: https://github.com/apache/qpid-dispatch/pull/711#issuecomment-605685842
 
 
   Please correct me if I am wrong here.
   
   If I set the debugDumpFile attribute of router entity and have QD_MEMORY_STATS as ON and run the system_tests_one_router, I see the following on stdout
   
   20: Router QDR debug dump file:
   20: alloc.c: Items of type 'qd_policy_settings_t' remain allocated at shutdown: 14
   
   It would be useful for me to see the alloaction backtrace of all the above 14 qd_policy_settings_t in the debugDumpFile, right ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ted-ross commented on a change in pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ted-ross merged pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.

Posted by GitBox <gi...@apache.org>.
ted-ross merged pull request #711: Added debug-dump backtrace for leaked objects in pooled memory.
URL: https://github.com/apache/qpid-dispatch/pull/711
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org