#include <xtd/console>
#include <xtd/memory_information>
auto main() -> int {
console::write_line("Physical memory");
console::write_line(" total = {,12} ({,3} GB)", memory_information::get_total_physical_memory(), memory_information::get_total_physical_memory() / 1024 / 1024 / 1024);
console::write_line(" used = {,12} ({,3} GB)", memory_information::get_used_physical_memory(), memory_information::get_used_physical_memory() / 1024 / 1024 / 1024);
console::write_line(" free = {,12} ({,3} GB)", memory_information::get_free_physical_memory(), memory_information::get_free_physical_memory() / 1024 / 1024 / 1024);
console::write_line();
console::write_line("Virtual memory");
console::write_line(" total = {,12} ({,3} GB)", memory_information::get_total_virtual_memory(), memory_information::get_total_virtual_memory() / 1024 / 1024 / 1024);
console::write_line(" used = {,12} ({,3} GB)", memory_information::get_used_virtual_memory(), memory_information::get_used_virtual_memory() / 1024 / 1024 / 1024);
console::write_line(" free = {,12} ({,3} GB)", memory_information::get_free_virtual_memory(), memory_information::get_free_virtual_memory() / 1024 / 1024 / 1024);
console::write_line();
console::write_line("Process memory");
console::write_line(" total = {,12} ({,3} GB)", memory_information::get_total_process_memory(), memory_information::get_total_process_memory() / 1024 / 1024 / 1024);
console::write_line(" used = {,12} ({,3} MB)", memory_information::get_used_process_memory(), memory_information::get_used_process_memory() / 1024 / 1024);
console::write_line(" free = {,12} ({,3} GB)", memory_information::get_free_process_memory(), memory_information::get_free_process_memory() / 1024 / 1024 / 1024);
}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10