ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
process_memory.h
Go to the documentation of this file.
1/**
2 * @file process_memory.h
3 * @brief Resident memory of a process, or of a process group.
4 *
5 * Used by @c provsql.max_memory (the backend's own memory, see
6 * @c provsql_interrupt.h) and @c provsql.tool_max_memory (an external tool
7 * and the processes it forks, see @c external_tool.cpp). Read from the
8 * operating system on Linux, macOS and FreeBSD; elsewhere the functions
9 * return 0, and the budgets they serve have no effect.
10 */
11#ifndef PROVSQL_PROCESS_MEMORY_H
12#define PROVSQL_PROCESS_MEMORY_H
13
14#include <cstddef>
15#include <sys/types.h>
16
17/** @brief The resident memory of process @p pid, in bytes, or 0 where the
18 * platform does not say. */
19std::size_t provsql_process_rss(pid_t pid);
20
21/** @brief The resident memory of the processes of group @p pgid, in bytes,
22 * or 0 where the platform does not say. */
23std::size_t provsql_process_group_rss(pid_t pgid);
24
25#endif /* PROVSQL_PROCESS_MEMORY_H */
std::size_t provsql_process_rss(pid_t pid)
The resident memory of process pid, in bytes, or 0 where the platform does not say.
std::size_t provsql_process_group_rss(pid_t pgid)
The resident memory of the processes of group pgid, in bytes, or 0 where the platform does not say.