Memory usage statistics for heap and pools.

This commit is contained in:
Ruben Ayrapetyan
2014-07-09 14:59:27 +04:00
parent d25d33cd58
commit aaf3d76cae
7 changed files with 552 additions and 166 deletions
+2
View File
@@ -82,5 +82,7 @@ main( int __unused argc,
}
}
mem_HeapPrint( false);
return 0;
} /* main */
+23
View File
@@ -93,5 +93,28 @@ main( int __unused argc,
}
}
mem_PoolsStats_t stats;
mem_PoolsGetStats( &stats);
libc_printf("Pools stats:\n");
for(mem_PoolChunkType_t type = 0;
type < MEM_POOL_CHUNK_TYPE__COUNT;
type++)
{
libc_printf(" Chunk size: %u\n"
" Pools: %lu\n"
" Allocated chunks: %lu\n"
" Free chunks: %lu\n"
" Peak pools: %lu\n"
" Peak allocated chunks: %lu\n",
mem_GetChunkSize( type),
stats.pools_count[ type ],
stats.allocated_chunks[ type ],
stats.free_chunks[ type ],
stats.peak_pools_count[ type ],
stats.peak_allocated_chunks[ type ]);
}
libc_printf("\n");
return 0;
} /* main */