| 1 | #ifndef AWS_COMMON_SYSTEM_RESOURCE_UTIL_H |
| 2 | #define AWS_COMMON_SYSTEM_RESOURCE_UTIL_H |
| 3 | |
| 4 | /** |
| 5 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 6 | * SPDX-License-Identifier: Apache-2.0. |
| 7 | */ |
| 8 | #include <aws/common/common.h> |
| 9 | |
| 10 | AWS_PUSH_SANE_WARNING_LEVEL |
| 11 | |
| 12 | AWS_EXTERN_C_BEGIN |
| 13 | |
| 14 | struct aws_memory_usage_stats { |
| 15 | size_t maxrss; /* max resident set size in kilobytes since program start */ |
| 16 | size_t page_faults; /* num of page faults since program start */ |
| 17 | |
| 18 | size_t _reserved[8]; |
| 19 | }; |
| 20 | |
| 21 | /* |
| 22 | * Get memory usage for current process. |
| 23 | * Raises AWS_ERROR_SYS_CALL_FAILURE on failure. |
| 24 | */ |
| 25 | AWS_COMMON_API int aws_init_memory_usage_for_current_process(struct aws_memory_usage_stats *memory_usage); |
| 26 | |
| 27 | AWS_EXTERN_C_END |
| 28 | AWS_POP_SANE_WARNING_LEVEL |
| 29 | |
| 30 | #endif /* AWS_COMMON_SYSTEM_RESOURCE_UTIL_H */ |