xtd 0.2.0
memory_information.cpp

Shows how to use xtd::memory_information class.

#include <xtd/console>
#include <xtd/memory_information>
using namespace xtd;
auto main() -> int {
console::write_line("Physical memory");
console::write_line("Virtual memory");
console::write_line("Process memory");
}
// This code can produce the following output :
//
// Physical memory
// total = 34359738368 ( 32 GB)
// used = 18914050048 ( 17 GB)
// free = 15445688320 ( 14 GB)
//
// Virtual memory
// total = 600992124928 (559 GB)
// used = 420945264640 (392 GB)
// free = 180046860288 (167 GB)
//
// Process memory
// total = 180046860288 (167 GB)
// used = 40550400 ( 38 MB)
// free = 180006309888 (167 GB)
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static xtd::size get_total_virtual_memory() noexcept
Gets the total virtual memory in bytes.
static xtd::size get_total_process_memory() noexcept
Gets the total physical memory in bytes.
static xtd::size get_total_physical_memory() noexcept
Gets the total physical memory in bytes.
static xtd::size get_free_process_memory() noexcept
Gets the free process memory in bytes.
static xtd::size get_free_virtual_memory() noexcept
Gets the free virtual memory in bytes.
static xtd::size get_used_process_memory() noexcept
Gets the used physical memory in bytes.
static xtd::size get_used_virtual_memory() noexcept
Gets the used virtual memory in bytes.
static xtd::size get_free_physical_memory() noexcept
Gets the free physical memory in bytes.
static xtd::size get_used_physical_memory() noexcept
Gets the used physical memory information in bytes.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8