Print out allocation statistics. More...
Data Structures | |
| struct | mi_stats_t |
| Statistics. See include/mimalloc-stats.h for the full definition. More... | |
Macros | |
| #define | MI_STAT_VERSION |
| Statistics version. Increased on each backward incompatible change. | |
| #define | mi_stats_t_decl(name) |
| Helper to declare a properly initialized mi_stats_t() local variable as name where the size and version fields are properly initialized. | |
Functions | |
| void | mi_process_info_print (void) |
| Print out all process info. | |
| void | mi_process_info_print_out (mi_output_fun *out, void *arg) |
| Print out all process info. | |
| void | mi_process_info (size_t *elapsed_msecs, size_t *user_msecs, size_t *system_msecs, size_t *current_rss, size_t *peak_rss, size_t *current_commit, size_t *peak_commit, size_t *page_faults) |
| Return process information (time and memory usage). | |
| void | mi_stats_print (void *out) |
| Deprecated. | |
| void | mi_stats_print_out (mi_output_fun *out, void *arg) |
| Print statistics of the current subprocess aggregated over all its heaps. | |
| bool | mi_stats_get (mi_stats_t *stats) |
| Get the statistics for the current subprocess aggregated over all its heaps. | |
| char * | mi_stats_get_json (size_t buf_size, char *buf) |
| Get the statistics for the current subprocess aggregated over all its heaps as JSON. | |
| size_t | mi_stats_get_bin_size (size_t bin) |
| v3: Return the block size for the given bin. | |
| bool | mi_heap_stats_get (mi_heap_t *heap, mi_stats_t *stats) |
| v3: Return statistics for a given heap. | |
| char * | mi_heap_stats_get_json (mi_heap_t *heap, size_t buf_size, char *buf) |
| v3: Get the statistics for a heap as JSON. | |
| void | mi_heap_stats_print_out (mi_heap_t *heap, mi_output_fun *out, void *arg) |
| v3: Show the heap statistics as JSON. | |
| void | mi_heap_stats_merge_to_subproc (mi_heap_t *heap) |
| v3: xplicitly merge the statistics of the current heap with the subprocess. | |
| bool | mi_subproc_stats_get (mi_subproc_id_t subproc_id, mi_stats_t *stats) |
| v3: Get statistics for a given subprocess aggregated over all its heaps. | |
| char * | mi_subproc_stats_get_json (mi_subproc_id_t subproc_id, size_t buf_size, char *buf) |
| v3: Show the subproc statistics aggregated over all its heaps as JSON. | |
| void | mi_subproc_stats_print_out (mi_subproc_id_t subproc_id, mi_output_fun *out, void *arg) |
| v3: Print the subproc statistics aggregated over all its heaps. | |
| void | mi_subproc_heap_stats_print_out (mi_subproc_id_t subproc_id, mi_output_fun *out, void *arg) |
| v3: Print statistics for a given subprocess with each heap separately printed. | |
| char * | mi_stats_as_json (mi_stats_t *stats, size_t buf_size, char *buf) |
| v3: Show the given statistics as JSON. | |
| void | mi_stats_reset (void) |
| v1,v2: Reset statistics. | |
| void | mi_stats_merge (void) |
| v1,v2: Merge thread local statistics with the main statistics and reset. | |
Print out allocation statistics.
| struct mi_stats_s |
Statistics. See include/mimalloc-stats.h for the full definition.
| #define MI_STAT_VERSION |
Statistics version. Increased on each backward incompatible change.
| #define mi_stats_t_decl | ( | name | ) |
Helper to declare a properly initialized mi_stats_t() local variable as name where the size and version fields are properly initialized.
For example:
| bool mi_heap_stats_get | ( | mi_heap_t * | heap, |
| mi_stats_t * | stats ) |
v3: Return statistics for a given heap.
| heap | The heap. |
| stats | Pointer to a mi_stats_t() structure (declared as mi_stats_t_decl(name)). |
sizeof(mi_stats_t) and MI_STAT_VERSION with the linked mimalloc version. | char * mi_heap_stats_get_json | ( | mi_heap_t * | heap, |
| size_t | buf_size, | ||
| char * | buf ) |
v3: Get the statistics for a heap as JSON.
| heap | The heap. |
| buf_size | Byte size of the buffer buf (or 0 if buf is NULL). |
| buf | The buffer. Pass NULL to allocate a fresh buffer. |
| void mi_heap_stats_merge_to_subproc | ( | mi_heap_t * | heap | ) |
v3: xplicitly merge the statistics of the current heap with the subprocess.
| heap | The heap. After this call, the heap statistics are reset. |
| void mi_heap_stats_print_out | ( | mi_heap_t * | heap, |
| mi_output_fun * | out, | ||
| void * | arg ) |
v3: Show the heap statistics as JSON.
| heap | The heap. |
| out | An output function or NULL for the default. |
| arg | Optional argument passed to out (if not NULL) |
| void mi_process_info | ( | size_t * | elapsed_msecs, |
| size_t * | user_msecs, | ||
| size_t * | system_msecs, | ||
| size_t * | current_rss, | ||
| size_t * | peak_rss, | ||
| size_t * | current_commit, | ||
| size_t * | peak_commit, | ||
| size_t * | page_faults ) |
Return process information (time and memory usage).
| elapsed_msecs | Optional. Elapsed wall-clock time of the process in milli-seconds. |
| user_msecs | Optional. User time in milli-seconds (as the sum over all threads). |
| system_msecs | Optional. System time in milli-seconds. |
| current_rss | Optional. Current working set size (touched pages). |
| peak_rss | Optional. Peak working set size (touched pages). |
| current_commit | Optional. Current committed memory (backed by the page file). |
| peak_commit | Optional. Peak committed memory (backed by the page file). |
| page_faults | Optional. Count of hard page faults. |
The current_rss is precise on Windows and MacOSX; other systems estimate this using current_commit. The commit is precise on Windows but estimated on other systems as the amount of read/write accessible memory reserved by mimalloc.
| void mi_process_info_print | ( | void | ) |
Print out all process info.
| void mi_process_info_print_out | ( | mi_output_fun * | out, |
| void * | arg ) |
Print out all process info.
| out | An output function or NULL for the default. |
| arg | Optional argument passed to out (if not NULL) |
| char * mi_stats_as_json | ( | mi_stats_t * | stats, |
| size_t | buf_size, | ||
| char * | buf ) |
v3: Show the given statistics as JSON.
| stats | The statistics. |
| buf_size | Byte size of the buffer buf (or 0 if buf is NULL). |
| buf | The buffer. Pass NULL to allocate a fresh buffer. |
| bool mi_stats_get | ( | mi_stats_t * | stats | ) |
Get the statistics for the current subprocess aggregated over all its heaps.
| stats | Pointer to a mi_stats_t() structure (declared as mi_stats_t_decl(name)). |
sizeof(mi_stats_t) and MI_STAT_VERSION with the linked mimalloc version. | size_t mi_stats_get_bin_size | ( | size_t | bin | ) |
v3: Return the block size for the given bin.
| char * mi_stats_get_json | ( | size_t | buf_size, |
| char * | buf ) |
Get the statistics for the current subprocess aggregated over all its heaps as JSON.
| buf_size | Byte size of the buffer buf (or 0 if buf is NULL) |
| buf | The buffer. Pass NULL to allocate a fresh buffer. |
| void mi_stats_merge | ( | void | ) |
v1,v2: Merge thread local statistics with the main statistics and reset.
| void mi_stats_print | ( | void * | out | ) |
Deprecated.
| out | Ignored, outputs to the registered output function or stderr by default. |
Most detailed when using a debug build.
| void mi_stats_print_out | ( | mi_output_fun * | out, |
| void * | arg ) |
Print statistics of the current subprocess aggregated over all its heaps.
| out | An output function or NULL for the default. |
| arg | Optional argument passed to out (if not NULL) |
Most detailed when using a debug build.
| void mi_stats_reset | ( | void | ) |
v1,v2: Reset statistics.
| void mi_subproc_heap_stats_print_out | ( | mi_subproc_id_t | subproc_id, |
| mi_output_fun * | out, | ||
| void * | arg ) |
v3: Print statistics for a given subprocess with each heap separately printed.
| subproc_id | The subprocess |
| out | An output function or NULL for the default. |
| arg | Optional argument passed to out (if not NULL) |
| bool mi_subproc_stats_get | ( | mi_subproc_id_t | subproc_id, |
| mi_stats_t * | stats ) |
v3: Get statistics for a given subprocess aggregated over all its heaps.
| subproc_id | The subprocess |
| stats | Pointer to a mi_stats_t() structure (declared as mi_stats_t_decl(name)). |
sizeof(mi_stats_t) and MI_STAT_VERSION with the linked mimalloc version. | char * mi_subproc_stats_get_json | ( | mi_subproc_id_t | subproc_id, |
| size_t | buf_size, | ||
| char * | buf ) |
v3: Show the subproc statistics aggregated over all its heaps as JSON.
| subproc_id | The subprocess. |
| buf_size | Byte size of the buffer buf (or 0 if buf is NULL). |
| buf | The buffer. Pass NULL to allocate a fresh buffer. |
| void mi_subproc_stats_print_out | ( | mi_subproc_id_t | subproc_id, |
| mi_output_fun * | out, | ||
| void * | arg ) |
v3: Print the subproc statistics aggregated over all its heaps.
| subproc_id | The subprocess. |
| out | An output function or NULL for the default. |
| arg | Optional argument passed to out (if not NULL) |