memory.h
/*
* libsysactivity
* http://sourceforge.net/projects/libsysactivity/
* Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SA_MEMORY_H_
#define SA_MEMORY_H_
struct sa_memory {
#ifdef SA_MEMORY_TOTAL
uint64_t total;
#endif
#ifdef SA_MEMORY_FREE
uint64_t free;
#endif
#ifdef SA_MEMORY_ACTIVE
uint64_t active;
#endif
#ifdef SA_MEMORY_INACTIVE
uint64_t inactive;
#endif
#ifdef SA_MEMORY_BUFFERS
uint64_t buffers;
#endif
#ifdef SA_MEMORY_SWAP_TOTAL
uint64_t swap_total;
#endif
#ifdef SA_MEMORY_SWAP_FREE
uint64_t swap_free;
#endif
#ifdef SA_MEMORY_SWAP_CACHED
uint64_t swap_cached;
#endif
#ifdef SA_MEMORY_WIRED
uint64_t wired;
#endif
#ifdef SA_MEMORY_CACHED
uint64_t cached;
#endif
#ifdef SA_MEMORY_DIRTY
uint64_t dirty;
#endif
#ifdef SA_MEMORY_EXECUTABLE
uint64_t executable;
#endif
#ifdef SA_MEMORY_FILES
uint64_t files;
#endif
#ifdef SA_MEMORY_LOCKED
uint64_t locked;
#endif
};
#ifdef SA_OPEN_MEMORY
int sa_open_memory(void) SA_EXPORT;
#endif
#ifdef SA_CLOSE_MEMORY
int sa_close_memory(void) SA_EXPORT;
#endif
int sa_get_memory(struct sa_memory* dst) SA_EXPORT SA_NONNULL;
#endif /* SA_MEMORY_H_ */
sa_memory::free
uint64_t free
Unused amount of memory.
Definition: memory.h:36
sa_memory::files
uint64_t files
Memory used by cached file data.
Definition: memory.h:69
sa_memory
Definition: memory.h:31
sa_open_memory
int sa_open_memory(void) SA_EXPORT
sa_memory::swap_free
uint64_t swap_free
Free amount of swap available.
Definition: memory.h:51
sa_close_memory
int sa_close_memory(void) SA_EXPORT
sa_memory::wired
uint64_t wired
Memory not placed on any queue.
Definition: memory.h:57
sa_memory::cached
uint64_t cached
Amount of cached memory.
Definition: memory.h:60
sa_memory::active
uint64_t active
Amount of memory in use or recently used.
Definition: memory.h:39
sa_memory::swap_total
uint64_t swap_total
Total amount of swap present in the system.
Definition: memory.h:48
sa_memory::buffers
uint64_t buffers
Memory used for cached files. Useless for metrics nowadays.
Definition: memory.h:45
sa_memory::executable
uint64_t executable
Memory used to hold executable data.
Definition: memory.h:66
sa_get_memory
int sa_get_memory(struct sa_memory *dst) SA_EXPORT SA_NONNULL
sa_memory::dirty
uint64_t dirty
Amount of memory waiting for been written to the disk.
Definition: memory.h:63
sa_memory::swap_cached
uint64_t swap_cached
Amount of swap that is cached.
Definition: memory.h:54
sa_memory::inactive
uint64_t inactive
Amount of memory that has not been recently used.
Definition: memory.h:42
sa_memory::locked
uint64_t locked
Memory that can not be moved to swap.
Definition: memory.h:72
sa_memory::total
uint64_t total
Total amount of RAM available in the system.
Definition: memory.h:33