Index: XIOS3/trunk/scripts/plotly_memory.js
===================================================================
--- XIOS3/trunk/scripts/plotly_memory.js	(revision 2424)
+++ XIOS3/trunk/scripts/plotly_memory.js	(revision 2425)
@@ -37,5 +37,7 @@
  	    time: +d.time,
  	    event: d.event,
- 	    memory: +d.memory
+ 	    vsize: +d.vsize,
+ 	    rss: +d.rss,
+ 	    VmHWM: +d.VmHWM
  	};
     }, function(xios_mem_obj) {
@@ -48,5 +50,5 @@
     // transpose data to use it more easily
     var transData = [];
-    for(var i = 0; i < 3 ; i++){
+    for(var i = 0; i < 5 ; i++){
 	transData.push([]);
     };
@@ -54,6 +56,8 @@
 	//console.log( xios_mem_data[i]  );
 	transData[0].push( xios_mem_data[i].time )   // x axis
-	transData[1].push( xios_mem_data[i].memory ) // y axis
+	transData[1].push( xios_mem_data[i].vsize ) // y axis
 	transData[2].push( xios_mem_data[i].event )  // labels
+	transData[3].push( xios_mem_data[i].rss ) // y axis
+	transData[4].push( xios_mem_data[i].VmHWM ) // y axis
     };
     //console.log(transData[0]);
@@ -66,6 +70,27 @@
 	mode: 'markers',
 	text: transData[2],
+        name:'vsize',
     };
     data.push(result);
+    
+    var result2 = {
+        x: transData[0],
+        y: transData[3],
+        type: 'scatter',
+        mode: 'markers',
+        text: transData[2],
+        name:'RSS',
+    };
+    data.push(result2);
+    
+    var result3 = {
+        x: transData[0],
+        y: transData[4],
+        type: 'scatter',
+        mode: 'markers',
+        text: transData[2],
+        name:'VmHWM',
+    };
+    data.push(result3);
 
     var layout = {
Index: XIOS3/trunk/src/mem_checker.cpp
===================================================================
--- XIOS3/trunk/src/mem_checker.cpp	(revision 2424)
+++ XIOS3/trunk/src/mem_checker.cpp	(revision 2425)
@@ -19,4 +19,6 @@
   bool CMemChecker::first_=true;
   double CMemChecker::vsize_init_=0;
+  double CMemChecker::rss_init_=0;
+  double CMemChecker::vmhwm_init_=0;
   double CMemChecker::time_init_=0;
   std::ofstream CMemChecker::fout_;
@@ -64,4 +66,63 @@
     return vsize ;
   }
+  
+  // Return vector of memories amount :
+  //   - vector[0] : virtual memory (vsize) from /proc/self/stat
+  //   - vector[1] : resident set size (rss) from /proc/self/stat
+  //   - vector[2] : Peak resident set size (VmHWM) from /proc/self/status
+  std::vector<double> CMemChecker::getMemories(void)
+  {
+    std::vector<double> memories;
+
+    if (first_) check() ;
+    if (!enabled_) return memories;
+    std::ifstream statStream("/proc/self/stat",std::ios_base::in);
+    std::string dummy ;
+    for(int i=1;i<=22;i++) statStream>>dummy ;
+
+    // 1 - Virtual
+    double vsize; 
+    statStream>>vsize ;
+    if (vsize_init_==0) {
+      vsize_init_ = vsize;
+      time_init_=MPI_Wtime();
+    }
+    vsize -= vsize_init_;
+    memories.push_back(vsize);
+
+    // 2 - RSS
+    double rss;
+    statStream>>rss ;
+    if (rss_init_==0) {
+      rss_init_ = rss;
+    }
+    rss -= rss_init_;
+    rss *= 4096; //getconf("PAGE_SIZE");    
+    memories.push_back(rss);
+
+    // 3 - Peak
+    char sbuf[1024];
+    std::ifstream file( "/proc/self/status" );
+    if( file.fail() ) {
+      return memories;
+    }
+    int fd = open( "/proc/self/status", O_RDONLY, 0 );
+    int num_read=read( fd, sbuf, ( sizeof sbuf )-1 );
+    close( fd );
+    if( !num_read ) {
+      return memories;             
+    }
+    // Peak resident set size
+    char *S=strstr( sbuf, "VmHWM:" )+6;
+    double vmhwm = ( int )atoi( S );
+    if (vmhwm_init_==0) {
+      vmhwm_init_ = vmhwm;
+    }
+    vmhwm -= vmhwm_init_;
+    memories.push_back(vmhwm);
+    
+    return memories;
+  }
+  
   void CMemChecker::logMem( std::string id, bool finalizeLog )
   {
@@ -71,13 +132,17 @@
     MPI_Comm_rank( MPI_COMM_WORLD, &rk );
     std::string logName("xios_memory_"+std::to_string(rk)+".csv");
-    double mem = getMemRSS();
-    if (!mem) {
+    vector<double> mem = getMemories();
+    if (!mem[0]) {
       fout_.open( logName );
-      fout_ << "time,event,memory" << std::endl;
+      fout_ << "time,event,vsize,rss,VmHWM" << std::endl;
     }
 
     fout_.precision(4);
     // Time format : YYYY-MM-DD HH:MM:SS.XXX -> seconds * 1000.
-    fout_ << (MPI_Wtime()-time_init_) << "," << id << "," << mem/1000000. << std::endl;
+    fout_ << (MPI_Wtime()-time_init_) << "," << id
+          << "," << mem[0]/1024./1024.
+          << "," << mem[1]/1024./1024.
+          << "," << mem[2]/1024.
+          << std::endl;
 
     if ((MPI_Wtime()-time_init_)>flush_counter_*600.)
Index: XIOS3/trunk/src/mem_checker.hpp
===================================================================
--- XIOS3/trunk/src/mem_checker.hpp	(revision 2424)
+++ XIOS3/trunk/src/mem_checker.hpp	(revision 2425)
@@ -5,4 +5,5 @@
 #include <map>
 #include <fstream>
+#include <vector>
 
 namespace xios
@@ -20,4 +21,5 @@
       static double getMem(void);
       static double getMemRSS(void);
+      static std::vector<double> getMemories(void);
       static void logMem( std::string id, bool finalizeLog = false );
       static CMemChecker& get(std::string name);
@@ -39,4 +41,6 @@
 
       static double vsize_init_;
+      static double rss_init_;
+      static double vmhwm_init_;
       static double time_init_;
       static std::ofstream fout_;
