NAME
memory_used - Returns the amount of heap storage used
SYNOPSIS
#include "l/l_sys_mal.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int memory_used(unsigned long *total_bytes_used_ptr);
DESCRIPTION
This routine returns the amount of heap storage used provided that this
facility is available on the current platform. If this facility is not
available, then ERROR is returned, with an error message being set.
Note that the amount of storage used is always greater than the number of
bytes allocated, sometimes by a substantial amount. This is because memory is
not returned to the system when it is freed; freed memory is simply available
for re-use by the allocating process.
RETURNS
The amount of heap storage used in bytes, if available, otherwise ERROR
is returned, with an error message being set.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Kobus Barnard
SEE ALSO
kjb_malloc
,
kjb_calloc
,
kjb_realloc
,
watch_for_free
,
check_initialization
,
optimize_free
,
optimize_free_2
,
kjb_free