xtd 0.2.0
Loading...
Searching...
No Matches

◆ get_total_virtual_memory()

static xtd::size xtd::memory_information::get_total_virtual_memory ( )
staticnoexcept

Gets the the total virtual memory in bytes.

Returns
The total virtual memory value.
Examples
The following example shows how to retrieve some information about the memory.
#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 the total virtual memory in bytes.
static xtd::size get_total_process_memory() noexcept
Gets the the total physical memory in bytes.
static xtd::size get_total_physical_memory() noexcept
Gets the the total physical memory in bytes.
static xtd::size get_free_process_memory() noexcept
Gets the the free process memory in bytes.
static xtd::size get_free_virtual_memory() noexcept
Gets the the free virtual memory in bytes.
static xtd::size get_used_process_memory() noexcept
Gets the the used physical memory in bytes.
static xtd::size get_used_virtual_memory() noexcept
Gets the the used virtual memory in bytes.
static xtd::size get_free_physical_memory() noexcept
Gets the the free physical memory in bytes.
static xtd::size get_used_physical_memory() noexcept
Gets the the used physical memory information in bytes.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Remarks
Each OS has its own way of managing and allocating virtual memory.
It is possible that the OS has no virtual memory, in which case the method will return 0.