diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2019-08-05 20:57:57 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2019-08-05 21:17:29 +0300 |
commit | b0d4cb6e06672d79d7c251b3904e0095e62e63b3 (patch) | |
tree | a8958215e2482fe3402e91e2277e2aa8c82461ec /src/slic3r/GUI/SysInfoDialog.cpp | |
parent | ef0e323d1b66b77ca005f05293807c9d05ff79be (diff) |
Memory usage is now shown in SysInfoDialog on all three platforms
Diffstat (limited to 'src/slic3r/GUI/SysInfoDialog.cpp')
-rw-r--r-- | src/slic3r/GUI/SysInfoDialog.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/slic3r/GUI/SysInfoDialog.cpp b/src/slic3r/GUI/SysInfoDialog.cpp index e9487ee15..a1bae8742 100644 --- a/src/slic3r/GUI/SysInfoDialog.cpp +++ b/src/slic3r/GUI/SysInfoDialog.cpp @@ -58,21 +58,19 @@ std::string get_mem_info(bool format_as_html) std::string b_end = format_as_html ? "</b>" : ""; std::string line_end = format_as_html ? "<br>" : "\n"; + std::string mem_info_str = log_memory_info(true); + std::istringstream mem_info(mem_info_str); + std::string value; + while (std::getline(mem_info, value, ':')) { + out << b_start << (value+": ") << b_end; + std::getline(mem_info, value, ';'); + out << value << line_end; + } + const Slic3r::UndoRedo::Stack &stack = wxGetApp().plater()->undo_redo_stack_main(); - out << b_start << "RAM size reserved for the Undo / Redo stack [MB]: " << b_end << Slic3r::format_memsize_MB(stack.get_memory_limit()) << line_end; - out << b_start << "RAM size occupied by the Undo / Redo stack [MB]: " << b_end << Slic3r::format_memsize_MB(stack.memsize()) << line_end << line_end; + out << b_start << "RAM size reserved for the Undo / Redo stack: " << b_end << Slic3r::format_memsize_MB(stack.get_memory_limit()) << line_end; + out << b_start << "RAM size occupied by the Undo / Redo stack: " << b_end << Slic3r::format_memsize_MB(stack.memsize()) << line_end << line_end; -#ifdef _WIN32 - HANDLE hProcess = ::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, ::GetCurrentProcessId()); - if (hProcess != nullptr) { - PROCESS_MEMORY_COUNTERS_EX pmc; - if (GetProcessMemoryInfo(hProcess, (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc))) - out << b_start << "WorkingSet [MB]: " << b_end << format_memsize_MB(pmc.WorkingSetSize) << line_end - << b_start << "PrivateBytes [MB]: " << b_end << format_memsize_MB(pmc.PrivateUsage) << line_end - << b_start << "Pagefile(peak) [MB]: " << b_end << format_memsize_MB(pmc.PagefileUsage) << "(" << format_memsize_MB(pmc.PeakPagefileUsage) << ")" << line_end; - CloseHandle(hProcess); - } -#endif return out.str(); } |