From 0722e563db4e7b4493e4c697f75fb6f6aee93ebb Mon Sep 17 00:00:00 2001 From: tbaudier Date: Wed, 1 Mar 2017 16:50:59 +0100 Subject: [PATCH] Be sure to have memory consuption in kB, MB, GB instead of kibibytes, ... --- common/clitkMemoryUsage.cxx | 2 +- common/vvImage.cxx | 2 +- vv/qt_ui/vvInfoPanel.ui | 7 ------- vv/vvMainWindow.cxx | 4 ++-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/common/clitkMemoryUsage.cxx b/common/clitkMemoryUsage.cxx index e2a095d..c95c285 100644 --- a/common/clitkMemoryUsage.cxx +++ b/common/clitkMemoryUsage.cxx @@ -49,7 +49,7 @@ double clitk::GetMemoryUsageInMb() // Search the current pid in the list of processes while (stat[i].pid != getpid()) i++; // Display total memory size - double mem = stat[i].proc_resident/1024/1024; // in Mb + double mem = stat[i].proc_resident/1000/1000; // in MB return mem; #else return 0.0; diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 47a0e34..c7e13cc 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -196,7 +196,7 @@ unsigned long vvImage::GetActualMemorySize() { unsigned long size = 0; for (unsigned int i = 0; i < mVtkImages.size(); i++) { - size += mVtkImages[i]->GetActualMemorySize(); + size += mVtkImages[i]->GetActualMemorySize()*1024; } return size; } diff --git a/vv/qt_ui/vvInfoPanel.ui b/vv/qt_ui/vvInfoPanel.ui index b0b8d39..8eb2d87 100644 --- a/vv/qt_ui/vvInfoPanel.ui +++ b/vv/qt_ui/vvInfoPanel.ui @@ -401,13 +401,6 @@ p, li { white-space: pre-wrap; } 0 - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">in mebibytes (2<span style=" vertical-align:super;">20</span> bytes, not 10<span style=" vertical-align:super;">6</span>)</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 7372419..aa10ded 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -416,7 +416,7 @@ void vvMainWindow::UpdateMemoryUsage() { // clitk::PrintMemory(true); if (clitk::GetMemoryUsageInMb() == 0) infoPanel->setMemoryInMb("NA"); - else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB"); + else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MB"); } //------------------------------------------------------------------------------ @@ -1173,7 +1173,7 @@ void vvMainWindow::ImageInfoChanged() sizeMM[i] = inputSize[i]*inputSpacing[i]; NPixel *= inputSize[i]; } - inputSizeInBytes = GetSizeInBytes(imageSelected->GetActualMemorySize()*1000); + inputSizeInBytes = GetSizeInBytes(imageSelected->GetActualMemorySize()); QString dim = QString::number(dimension) + " ("; dim += pixelType + ")"; -- 2.47.1