]> Creatis software - clitk.git/commitdiff
Be sure to have memory consuption in kB, MB, GB instead of kibibytes, ...
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 1 Mar 2017 15:50:59 +0000 (16:50 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 1 Mar 2017 15:50:59 +0000 (16:50 +0100)
common/clitkMemoryUsage.cxx
common/vvImage.cxx
vv/qt_ui/vvInfoPanel.ui
vv/vvMainWindow.cxx

index e2a095dab5e080dae4e058b2517be8233c450a45..c95c2859b925e7f7dfa24575e4b53d28d88f53b6 100644 (file)
@@ -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;
index 47a0e3464bd1d6e995b8a3103bab742566a5459b..c7e13cc60b12fe9b98193efb232c8b1792802371 100644 (file)
@@ -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;
 }
index b0b8d39d879bbff1b9faed78be1c21baaf00dfdb..8eb2d87606b2a1142619fd3be4a39180559d3141 100644 (file)
@@ -401,13 +401,6 @@ p, li { white-space: pre-wrap; }
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
-         <property name="toolTip">
-          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;in mebibytes (2&lt;span style=&quot; vertical-align:super;&quot;&gt;20&lt;/span&gt; bytes, not 10&lt;span style=&quot; vertical-align:super;&quot;&gt;6&lt;/span&gt;)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
          <property name="text">
           <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
index 73724194a7c109d3dc4821913a51a791ff6ca573..aa10ded56d9944dcb11d86c8f39085e3bf95f96e 100644 (file)
@@ -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 + ")";