CI: tweaked memory leak output formatting

pull/271/head
SChernykh 2023-07-19 16:06:00 +02:00
parent ebae616138
commit 2ddb03e2be
2 changed files with 8 additions and 2 deletions

View File

@ -123,7 +123,8 @@ void show_top_10_allocations()
std::sort(buf, end, [](const auto& a, const auto& b) { return a.allocated_size > b.allocated_size; }); std::sort(buf, end, [](const auto& a, const auto& b) { return a.allocated_size > b.allocated_size; });
printf("%I64u total bytes allocated\n", total_allocated); printf("%I64u total bytes allocated\n\n", total_allocated);
printf("Top 10 allocations:\n\n");
for (TrackedAllocation* p = buf; (p < buf + 10) && (p < end); ++p) { for (TrackedAllocation* p = buf; (p < buf + 10) && (p < end); ++p) {
printf("%I64u bytes allocated at:\n", p->allocated_size); printf("%I64u bytes allocated at:\n", p->allocated_size);
@ -131,6 +132,8 @@ void show_top_10_allocations()
} }
} }
printf("\n");
VirtualFree(buf, 0, MEM_RELEASE); VirtualFree(buf, 0, MEM_RELEASE);
} }
@ -300,6 +303,9 @@ bool memory_tracking_stop()
if (total_leaks > 0) { if (total_leaks > 0) {
printf("%I64u bytes leaked\n\n", total_leaks); printf("%I64u bytes leaked\n\n", total_leaks);
} }
else {
printf("No memory leaks detected\n\n");
}
SymCleanup(h); SymCleanup(h);

View File

@ -2102,7 +2102,7 @@ void SideChain::prune_old_blocks()
m_pool->reconnect_to_host(); m_pool->reconnect_to_host();
} }
if (cur_time >= m_firstPruneTime + 120) { if ((cur_time >= m_firstPruneTime + 120) && !m_pool->stopped()) {
LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now"); LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now");
#ifdef DEV_TRACK_MEMORY #ifdef DEV_TRACK_MEMORY
show_top_10_allocations(); show_top_10_allocations();