| KDK_RTI_GET_MEM_VIRT_ALLOC_KIB(3) | Library Functions Manual | KDK_RTI_GET_MEM_VIRT_ALLOC_KIB(3) |
NAME
kdk_rti_get_mem_virt_alloc_KiB - 获取实际空闲的物理内存大小
SYNOPSIS
#include <libkyrtinfo.h> extern unsigned long kdk_rti_get_mem_virt_alloc_KiB(); Link with -lkyrtinfo.
Detailed Description
The main function of the interface is to obtain the total amount of virtual memory requested by all apps.
RETURN VALUE
On success, returns the total virtual memory requests of type unsigned long; The unit is KiB.
On error, return 0.
EXAMPLES
#include "libkyrtinfo.h"
#include <stdio.h>
int main()
{
printf("内存总大小:%lu KiB0, kdk_rti_get_mem_res_total_KiB());
printf("当前已用内存:%lu KiB,%f0, kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent());
printf("当前空闲内存:%lu KiB0, kdk_rti_get_mem_res_free_KiB());
printf("可用内存大小:%lu KiB0, kdk_rti_get_mem_res_available_KiB());
printf("应用总申请虚拟内存大小:%lu KiB0, kdk_rti_get_mem_virt_alloc_KiB());
printf("交换分区总量:%lu KiB0, kdk_rti_get_mem_swap_total_KiB());
printf("交换分区已用量:%lu KiB, %f0, kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent());
printf("交换分区剩余大小:%lu KiB0, kdk_rti_get_mem_swap_free_KiB());
printf("当前CPU使用率:%f0, kdk_rti_get_cpu_current_usage());
unsigned int day, hour, min, sec;
kdk_rti_get_uptime(&day, &hour, &min, &sec);
printf("开机时长:%u天%u小时%u分钟%u秒0, day, hour, min, sec);
return 0;
}
CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_rti_get_mem_res_total_KiB(), kdk_rti_get_mem_res_usage_percent(), kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_available_KiB(), kdk_rti_get_mem_res_free_KiB(), kdk_rti_get_mem_swap_total_KiB(), kdk_rti_get_mem_swap_usage_percent(), kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_free_KiB(), kdk_rti_get_cpu_current_usage() and kdk_rti_get_uptime().
SEE ALSO
kdk_rti_get_mem_res_total_KiB(3), kdk_rti_get_mem_res_usage_percent(3), kdk_rti_get_mem_res_usage_KiB(3), kdk_rti_get_mem_res_available_KiB(3), kdk_rti_get_mem_res_free_KiB(3), kdk_rti_get_mem_swap_total_KiB(), kdk_rti_get_mem_swap_usage_percent(3), kdk_rti_get_mem_swap_usage_KiB(3), kdk_rti_get_mem_swap_free_KiB(3), kdk_rti_get_cpu_current_usage(3) and kdk_rti_get_uptime(3).
| Mon Sep 18 2023 | Linux Programmer's Manual |