Turi Create  4.0
turi::memory_info Namespace Reference

Memory info namespace contains functions used to compute memory usage. More...

Functions

bool available ()
 Returns whether memory info reporting is available on this system (if memory_info was built with TCMalloc) More...
 
size_t heap_bytes ()
 Estimates the total current size of the memory heap in bytes. If memory info is not available then 0 is returned. More...
 
size_t allocated_bytes ()
 Determines the total number of allocated bytes. If memory info is not available then 0 is returned. More...
 
void print_usage (const std::string &label="")
 Print a memory usage summary prefixed by the string argument. More...
 
void log_usage (const std::string &label="")
 Log a memory usage summary prefixed by the string argument. More...
 

Detailed Description

Memory info namespace contains functions used to compute memory usage.

memory info functions require TCMalloc to actually compute memory usage values. If TCMalloc is not present then calls to memory info will generate warnings and return the default value.

Function Documentation

◆ allocated_bytes()

size_t turi::memory_info::allocated_bytes ( )
inline

Determines the total number of allocated bytes. If memory info is not available then 0 is returned.

Returns
the total bytes allocated

Definition at line 71 of file memory_info.hpp.

◆ available()

bool turi::memory_info::available ( )
inline

Returns whether memory info reporting is available on this system (if memory_info was built with TCMalloc)

Returns
if memory info is available on this system.

Definition at line 35 of file memory_info.hpp.

◆ heap_bytes()

size_t turi::memory_info::heap_bytes ( )
inline

Estimates the total current size of the memory heap in bytes. If memory info is not available then 0 is returned.

Returns
size of heap in bytes

Definition at line 51 of file memory_info.hpp.

◆ log_usage()

void turi::memory_info::log_usage ( const std::string &  label = "")
inline

Log a memory usage summary prefixed by the string argument.

Parameters
[in]labelthe string to print before the memory usage summary.

Definition at line 116 of file memory_info.hpp.

◆ print_usage()

void turi::memory_info::print_usage ( const std::string &  label = "")
inline

Print a memory usage summary prefixed by the string argument.

Parameters
[in]labelthe string to print before the memory usage summary.

Definition at line 92 of file memory_info.hpp.