Index: XIOS3/branches/xios-3.0-beta/bld.cfg
===================================================================
--- XIOS3/branches/xios-3.0-beta/bld.cfg	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/bld.cfg	(revision 2427)
@@ -53,5 +53,5 @@
 bld::target xios_server.exe 
 bld::target generic_testcase.exe 
-bld::target test_ugrid.exe
+#bld::target test_ugrid.exe
 #bld::target test_regular.exe
 #bld::target test_xios2_cmip6.exe
Index: XIOS3/branches/xios-3.0-beta/scripts/index_load.html
===================================================================
--- XIOS3/branches/xios-3.0-beta/scripts/index_load.html	(revision 2427)
+++ XIOS3/branches/xios-3.0-beta/scripts/index_load.html	(revision 2427)
@@ -0,0 +1,75 @@
+
+<head>
+  <script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-base.min.js" type="text/javascript"></script>
+  <script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-stock.min.js"></script>
+
+</head>
+
+<body>
+  <!--
+      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
+
+    <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
+
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
+    <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet" type="text/css" />
+
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
+    <link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" rel="stylesheet" type="text/css" />
+
+    <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
+    <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
+
+  <div id="container" >
+    <div class="row">
+      <label class="btn btn-primary" for="file">
+        <input type="file" id="file" style="display:none" onchange="$('#upload-file-info').html(this.files[0].name)">
+        Load a JS XIOS memory file
+      </label>
+      <button type="button" class="btn btn-default disabled" id="upload-file-info">...</button>
+    </div>
+  </div>
+  -->
+
+  <div id="container" ></div>
+  <script src="mem_4.js" ></script>
+
+  <script>
+    anychart.onDocumentLoad(function () {
+
+      
+        
+    // create a data table using this data
+    var dataTable = anychart.data.table();
+    dataTable.addData(get_xios_mem_data());
+ 
+    mapping_mem = dataTable.mapAs();
+    mapping_mem.addField('value', 2);
+    mapping_event = dataTable.mapAs();
+    mapping_event.addField('value', 1);
+ 
+    // create a stock chart
+    var chart = anychart.stock();
+
+    // create a plot on the chart
+    var plot = chart.plot(0);		
+	
+    // create a line series
+    var lineSeries2 = plot.line(mapping_event);
+    lineSeries2.name("Event");
+    var lineSeries1 = plot.line(mapping_mem);
+    lineSeries1.name("Mo");
+	
+    // set the container id
+    chart.container("container");
+ 
+    // initiate drawing the chart
+    chart.draw();
+
+
+
+	
+    });
+  </script>
+  
+</body>
Index: XIOS3/branches/xios-3.0-beta/scripts/plotly_memory.js
===================================================================
--- XIOS3/branches/xios-3.0-beta/scripts/plotly_memory.js	(revision 2427)
+++ XIOS3/branches/xios-3.0-beta/scripts/plotly_memory.js	(revision 2427)
@@ -0,0 +1,108 @@
+
+Plotly.d3.select('body')
+    .append('div')
+    .html("Select a CSV XIOS file");
+
+// ------------------ select csv data
+var input = Plotly.d3.select("body").append("input")
+    .attr("type","file")
+    .attr("accept",".csv")
+    .on("change", handleFileSelect)
+
+
+// Single file handler
+function handleFileSelect() {
+    // Check for the various File API support.
+    if (window.File && window.FileReader && window.FileList && window.Blob) {
+    // Great success! All the File APIs are supported.
+    } else {
+        alert('The File APIs are not fully supported in this browser.');
+    }
+
+    var f = event.target.files[0]; // FileList object
+    var reader = new FileReader();
+
+    reader.onload = function(event) {
+        makeplot_read_selected(event.target.result)
+    };
+    // Read in the file as a data URL.
+    reader.readAsDataURL(f);
+}
+
+
+function makeplot_read_selected(filename) {
+    Plotly.d3.csv(filename,  function(d) {
+	// formating data
+ 	return {
+ 	    time: +d.time,
+ 	    event: d.event,
+ 	    vsize: +d.vsize,
+ 	    rss: +d.rss,
+ 	    VmHWM: +d.VmHWM
+ 	};
+    }, function(xios_mem_obj) {
+ 	processData(xios_mem_obj)
+    });
+};
+
+function processData(xios_mem_data) {
+
+    // transpose data to use it more easily
+    var transData = [];
+    for(var i = 0; i < 5 ; i++){
+	transData.push([]);
+    };
+    for(var i = 0; i < xios_mem_data.length ; i++){
+	//console.log( xios_mem_data[i]  );
+	transData[0].push( xios_mem_data[i].time )   // x 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]);
+
+    var data = [];
+    var result = {
+	x: transData[0],
+	y: transData[1],
+	type: 'scatter',
+	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 = {
+	title: "Memory consumption",
+	xaxis: {
+	    title: "Time (s)",
+	},
+	yaxis: {
+	    title: "Memory (Mo)",
+	}
+    };
+
+    Plotly.newPlot('myDiv', data, layout);
+    
+}
Index: XIOS3/branches/xios-3.0-beta/scripts/xios_memory.html
===================================================================
--- XIOS3/branches/xios-3.0-beta/scripts/xios_memory.html	(revision 2427)
+++ XIOS3/branches/xios-3.0-beta/scripts/xios_memory.html	(revision 2427)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
+  </head>
+
+  <body>
+    
+    <div id=myDiv></div>
+    <script src="plotly_memory.js"></script>
+		  
+  </body>
+</html>
Index: XIOS3/branches/xios-3.0-beta/src/client.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/client.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/client.cpp	(revision 2427)
@@ -18,4 +18,5 @@
 #include "workflow_graph.hpp"
 #include "release_static_allocation.hpp"
+#include "mem_checker.hpp"
 
 namespace xios
@@ -519,4 +520,5 @@
       report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ;
       report(100)<<CTimer::getAllCumulatedTime()<<endl ;
+      report(100)<<CMemChecker::getAllCumulatedMem()<<endl ;
       CWorkflowGraph::drawWorkFlowGraph_client();
 
Index: XIOS3/branches/xios-3.0-beta/src/cxios.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/cxios.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/cxios.cpp	(revision 2427)
@@ -54,4 +54,5 @@
   bool CXios::checkSumRecv=false ;
   bool CXios::checkSumSend=false ;
+  bool CXios::logMemory=false ;
 
   CDaemonsManager*    CXios::daemonsManager_=nullptr ;
@@ -115,4 +116,6 @@
     checkSumSend = getin<bool>("checksum_send_fields", false);
     checkSumRecv = getin<bool>("checksum_recv_fields", false);
+
+    logMemory = getin<bool>("log_memory", false);
 
     globalComm=MPI_COMM_WORLD ;
@@ -149,4 +152,5 @@
       CClient::openErrorStream();
     }
+    CMemChecker::logMem("CXios::initClientSide");
   }
   CATCH
@@ -154,4 +158,6 @@
   void CXios::clientFinalize(void)
   {
+     CMemChecker::logMem("CXios::clientFinalize", true);
+
      CClient::finalize() ;
           
@@ -231,5 +237,4 @@
 #endif
     CMemChecker::get("xios").suspend() ;
-    report(0)<<CMemChecker::getAllCumulatedMem() ;
     CServer::closeInfoStream();
   }
Index: XIOS3/branches/xios-3.0-beta/src/cxios.hpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/cxios.hpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/cxios.hpp	(revision 2427)
@@ -68,4 +68,6 @@
      static bool checkSumRecv; //!< For debugging, compute a checksum of fields received by the model through the XIOS client
 
+     static bool logMemory; //!< Activate memory monitoring for all XIOS process
+
      static const string defaultPoolId ;
      static const string defaultServerId ;
Index: XIOS3/branches/xios-3.0-beta/src/filter/model_to_client_source_filter.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/filter/model_to_client_source_filter.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/filter/model_to_client_source_filter.cpp	(revision 2427)
@@ -5,4 +5,5 @@
 #include <limits> 
 #include "workflow_graph.hpp"
+#include "mem_checker.hpp"
 
 namespace xios
@@ -37,4 +38,6 @@
     packet->data.resize(connector->getDstSize()) ;
     connector->transfer(data, packet->data, nanValue) ;
+
+    CMemChecker::logMem( "CModelToClientSourceFilter::streamData" );
 
     if (hasMissingValue_)
Index: XIOS3/branches/xios-3.0-beta/src/filter/temporal_filter.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/filter/temporal_filter.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/filter/temporal_filter.cpp	(revision 2427)
@@ -3,4 +3,5 @@
 #include "calendar_util.hpp"
 #include "workflow_graph.hpp"
+#include "mem_checker.hpp"
 
 namespace xios
@@ -117,4 +118,6 @@
           packet = data[0];
 
+        CMemChecker::logMem( "CTemporalFilter::apply" );
+
         isFirstOperation = false;
         graphCycleCompleted = true;
Index: XIOS3/branches/xios-3.0-beta/src/interface/c/iccalendar.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/interface/c/iccalendar.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/interface/c/iccalendar.cpp	(revision 2427)
@@ -4,4 +4,5 @@
 #include "exception.hpp"
 #include "timer.hpp"
+#include "mem_checker.hpp"
 #include "context.hpp"
 #include "context_client.hpp"
@@ -12,4 +13,5 @@
   TRY
   {
+    CMemChecker::get("XIOS update calendar").resume();
     CTimer::get("XIOS").resume();
     CTimer::get("XIOS update calendar").resume();
@@ -23,4 +25,5 @@
     CTimer::get("XIOS update calendar").suspend();
     CTimer::get("XIOS").suspend();
+    CMemChecker::get("XIOS update calendar").suspend();
   }
   CATCH_DUMP_STACK
Index: XIOS3/branches/xios-3.0-beta/src/interface/c/icdata.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/interface/c/icdata.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/interface/c/icdata.cpp	(revision 2427)
@@ -25,4 +25,5 @@
 #include "mpi.hpp"
 #include "timer.hpp"
+#include "mem_checker.hpp"
 #include "array_new.hpp"
 
@@ -119,4 +120,6 @@
    TRY
    {
+     CMemChecker::get("XIOS close definition").resume();
+
      CTimer::get("XIOS").resume();
      CTimer::get("XIOS close definition").resume();
@@ -125,4 +128,6 @@
      CTimer::get("XIOS close definition").suspend();
      CTimer::get("XIOS").suspend();
+     
+     CMemChecker::get("XIOS close definition").suspend();
    }
    CATCH_DUMP_STACK
@@ -419,4 +424,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -428,4 +434,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -446,4 +453,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -458,4 +466,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -476,4 +485,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -488,4 +498,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -508,4 +519,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -520,4 +532,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -542,4 +555,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -554,4 +568,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -578,4 +593,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -590,4 +606,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -613,4 +630,5 @@
    {
  
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -625,4 +643,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -649,4 +668,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -661,4 +681,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -683,4 +704,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -695,4 +717,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -712,4 +735,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -726,4 +750,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -742,4 +767,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -756,4 +782,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -774,4 +801,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -788,4 +816,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -807,4 +836,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -821,4 +851,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -843,4 +874,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -857,4 +889,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -878,4 +911,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -892,4 +926,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -913,4 +948,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS send field").resume();
@@ -927,4 +963,5 @@
       CTimer::get("XIOS send field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -948,4 +985,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -960,4 +998,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -976,4 +1015,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -988,4 +1028,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1003,4 +1044,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1015,4 +1057,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1031,4 +1074,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1043,4 +1087,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1061,4 +1106,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1073,4 +1119,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1092,4 +1139,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1104,4 +1152,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1123,4 +1172,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1135,4 +1185,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1155,4 +1206,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1167,4 +1219,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1190,4 +1243,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1204,4 +1258,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1221,4 +1276,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1235,4 +1291,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1253,4 +1310,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1267,4 +1325,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
    }
    CATCH_DUMP_STACK
@@ -1284,4 +1343,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1298,4 +1358,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -1316,4 +1377,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1330,4 +1392,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -1351,4 +1414,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1365,4 +1429,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -1385,4 +1450,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1399,4 +1465,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
@@ -1421,4 +1488,5 @@
    TRY
    {
+      CMemChecker::get("XIOS send field").resume();
       CTimer::get("XIOS").resume();
       CTimer::get("XIOS recv field").resume();
@@ -1435,4 +1503,5 @@
       CTimer::get("XIOS recv field").suspend();
       CTimer::get("XIOS").suspend();
+      CMemChecker::get("XIOS send field").suspend();
     }
    CATCH_DUMP_STACK
Index: XIOS3/branches/xios-3.0-beta/src/interface/c/icmem_checker.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/interface/c/icmem_checker.cpp	(revision 2427)
+++ XIOS3/branches/xios-3.0-beta/src/interface/c/icmem_checker.cpp	(revision 2427)
@@ -0,0 +1,32 @@
+
+#include "mem_checker.hpp"
+#include <string>
+#include <iostream>
+
+
+using namespace xios;
+
+extern "C"
+{
+  void cxios_mem_checker_get(double* mem)
+  {
+    std::vector<double> memories = CMemChecker::getMem();
+    if (memories.size()>1)
+    {
+      *mem=memories[1]; //rss
+    }
+    else
+    {
+      *mem = 0.;
+    }
+  }
+
+  void cxios_mem_checker_log(const char* mem_id, int len_mem_id, bool* finalize)
+  {
+    std::string str(mem_id,len_mem_id);
+    CMemChecker::logMem(str, *finalize);
+  }
+
+}
+
+
Index: XIOS3/branches/xios-3.0-beta/src/interface/fortran/imem_checker.F90
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/interface/fortran/imem_checker.F90	(revision 2427)
+++ XIOS3/branches/xios-3.0-beta/src/interface/fortran/imem_checker.F90	(revision 2427)
@@ -0,0 +1,46 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IMEM_CHECKER
+   USE, INTRINSIC :: ISO_C_BINDING
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+      
+      SUBROUTINE cxios_mem_checker_get(mem) BIND(C)
+         USE ISO_C_BINDING
+         REAL     (kind = C_DOUBLE), VALUE        :: mem
+      END SUBROUTINE cxios_mem_checker_get
+
+      SUBROUTINE cxios_mem_checker_log(memid, memid_size, finalize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: memid
+         INTEGER  (kind = C_INT)   , VALUE        :: memid_size
+         LOGICAL  (kind = C_BOOL)                 :: finalize
+      END SUBROUTINE cxios_mem_checker_log
+       
+   END INTERFACE
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   FUNCTION xios(mem_checker_get)() RESULT(mem)
+      IMPLICIT NONE
+      REAL                                       :: mem
+      REAL(KIND=C_DOUBLE)                        :: mem_
+      
+      CALL cxios_mem_checker_get(mem_)
+      mem=mem_
+   END FUNCTION xios(mem_checker_get)
+ 
+   SUBROUTINE xios(mem_checker_log)(mem_id, finalize)
+   USE ISO_C_BINDING
+      IMPLICIT NONE
+      CHARACTER(len = *) , INTENT(IN) :: mem_id
+      LOGICAL, OPTIONAL,INTENT(IN)    :: finalize
+      LOGICAL (KIND=C_BOOL)           :: finalize_               
+
+      finalize_=.FALSE.
+      IF (PRESENT(finalize)) finalize_ = finalize
+      CALL cxios_mem_checker_log(mem_id, len(mem_id), finalize_)
+
+   END SUBROUTINE xios(mem_checker_log)
+
+END MODULE IMEM_CHECKER
Index: XIOS3/branches/xios-3.0-beta/src/interface/fortran/ixios.F90
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/interface/fortran/ixios.F90	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/interface/fortran/ixios.F90	(revision 2427)
@@ -38,4 +38,5 @@
                   ASSIGNMENT(=)
 USE itimer, ONLY : xios(timer_resume), xios(timer_suspend), xios(timer_reset), xios(timer_get_time)
+USE imem_checker, ONLY : xios(mem_checker_get), xios(mem_checker_log)
 
 USE ifield, ONLY : txios(field), txios(fieldgroup), xios(is_valid_field), xios(is_valid_fieldgroup)
Index: XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface.cpp	(revision 2427)
@@ -10,4 +10,5 @@
 #include "netCdfInterface.hpp"
 #include "netCdfException.hpp"
+#include "mem_checker.hpp"
 
 namespace xios
@@ -22,4 +23,5 @@
 int CNetCdfInterface::create(const StdString& fileName, int cMode, int& ncId)
 {
+  CMemChecker::get("NetCDF create").resume();
   int status = nc_create(fileName.c_str(), cMode, &ncId);
   if (NC_NOERR != status)
@@ -34,4 +36,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF create").suspend();
 
   return status;
@@ -49,4 +52,5 @@
 int CNetCdfInterface::createPar(const StdString& fileName, int cMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
+  CMemChecker::get("NetCDF create").resume();
   int status = xios::nc_create_par(fileName.c_str(), cMode, comm, info, &ncId);
   if (NC_NOERR != status)
@@ -61,4 +65,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF create").suspend();
 
   return status;
@@ -74,4 +79,5 @@
 int CNetCdfInterface::open(const StdString& fileName, int oMode, int& ncId)
 {
+  CMemChecker::get("NetCDF open").resume();
   int status = nc_open(fileName.c_str(), oMode, &ncId);
   if (NC_NOERR != status)
@@ -86,4 +92,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF open").suspend();
 
   return status;
@@ -102,4 +109,5 @@
 int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
+  CMemChecker::get("NetCDF open").resume();
   int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId);
   if (NC_NOERR != status)
@@ -114,4 +122,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF open").suspend();
 
   return status;
@@ -125,4 +134,5 @@
 int CNetCdfInterface::close(int ncId)
 {
+  CMemChecker::get("NetCDF close").resume();
   int status = nc_close(ncId);
   if (NC_NOERR != status)
@@ -136,4 +146,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF close").suspend();
 
   return status;
@@ -147,4 +158,5 @@
 int CNetCdfInterface::reDef(int ncId)
 {
+  CMemChecker::get("NetCDF other").resume();
   int status = nc_redef(ncId);
   if (NC_NOERR != status)
@@ -158,4 +170,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
@@ -169,4 +182,5 @@
 int CNetCdfInterface::endDef(int ncId)
 {
+  CMemChecker::get("NetCDF other").resume();
   int status = nc_enddef(ncId);
   if (NC_NOERR != status)
@@ -181,4 +195,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
@@ -773,4 +788,5 @@
 int CNetCdfInterface::setFill(int ncid, bool fill)
 {
+  CMemChecker::get("NetCDF other").resume();
   int old_fill_mode;
   int status = nc_set_fill(ncid, fill ? NC_FILL: NC_NOFILL, &old_fill_mode);
@@ -786,4 +802,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
@@ -801,4 +818,5 @@
 int CNetCdfInterface::defVarFill(int ncid, int varId, int noFill, void* fillValue)
 {
+  CMemChecker::get("NetCDF other").resume();
   int status = nc_def_var_fill(ncid, varId, noFill, fillValue);
   if (NC_NOERR != status)
@@ -814,4 +832,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
@@ -829,4 +848,5 @@
 int CNetCdfInterface::varParAccess(int ncid, int varId, int access)
 {
+  CMemChecker::get("NetCDF other").resume();
   int status = nc_var_par_access(ncid, varId, access);
   if (NC_NOERR != status)
@@ -841,4 +861,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
@@ -852,4 +873,5 @@
 int CNetCdfInterface::sync(int ncid)
 {
+  CMemChecker::get("NetCDF other").resume();
   int status = nc_sync(ncid);
   if (NC_NOERR != status)
@@ -864,4 +886,5 @@
     throw CNetCdfException(e);
   }
+  CMemChecker::get("NetCDF other").suspend();
 
   return status;
Index: XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface_impl.hpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface_impl.hpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface_impl.hpp	(revision 2427)
@@ -13,4 +13,5 @@
 #include "netCdfInterface.hpp"
 #include "netCdfException.hpp"
+#include "mem_checker.hpp"
 
 namespace xios
@@ -28,4 +29,5 @@
   int CNetCdfInterface::getAttType(int ncid, int varId, const StdString& attrName, T* data)
   {
+    CMemChecker::get("NetCDF get/put").resume();
     int status = ncGetAttType(ncid, varId, attrName.c_str(), data);
     if (NC_NOERR != status)
@@ -39,4 +41,5 @@
       throw CNetCdfException(sstr.str());
     }
+    CMemChecker::get("NetCDF get/put").suspend();
 
     return status;
@@ -57,4 +60,5 @@
                                    StdSize numVal, const T* data)
   {
+    CMemChecker::get("NetCDF get/put").resume();
     int status = ncPutAttType(ncid, varId, attrName.c_str(), numVal, data);
     if (NC_NOERR != status)
@@ -69,4 +73,5 @@
       throw CNetCdfException(sstr.str());
     }
+    CMemChecker::get("NetCDF get/put").suspend();
 
     return status;
@@ -85,4 +90,5 @@
   int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data)
   {
+    CMemChecker::get("NetCDF get/put").resume();
     int status = ncGetVaraType(ncid, varId, start, count, data);
     if (NC_NOERR != status)
@@ -96,4 +102,5 @@
       throw CNetCdfException(sstr.str());
     }
+    CMemChecker::get("NetCDF get/put").suspend();
 
     return status;
@@ -112,4 +119,5 @@
   int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, const T* data)
   {
+    CMemChecker::get("NetCDF get/put").resume();
     int status = ncPutVaraType(ncid, varId, start, count, data);
     if (NC_NOERR != status)
@@ -123,4 +131,5 @@
       throw CNetCdfException(sstr.str());
     }
+    CMemChecker::get("NetCDF get/put").suspend();
 
     return status;
Index: XIOS3/branches/xios-3.0-beta/src/mem_checker.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/mem_checker.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/mem_checker.cpp	(revision 2427)
@@ -1,3 +1,4 @@
 #include "mem_checker.hpp"
+#include "cxios.hpp"
 #include "mpi.hpp"
 #include <string>
@@ -5,5 +6,9 @@
 #include <iostream>
 #include <sstream>
-#include <fstream>
+
+#include <fcntl.h>
+#include <iomanip>
+#include <unistd.h>
+#include <cstring>
 
 namespace xios
@@ -13,6 +18,12 @@
   bool CMemChecker::enabled_=true;
   bool CMemChecker::first_=true;
-
-  CMemChecker::CMemChecker(const std::string& name) : name_(name) 
+  double CMemChecker::vsize_init_=0;
+  double CMemChecker::rss_init_=0;
+  double CMemChecker::vmhwm_init_=0;
+  double CMemChecker::time_init_=0;
+  std::ofstream CMemChecker::fout_;
+  int CMemChecker::flush_counter_=1;
+  
+  CMemChecker::CMemChecker(const std::string& name) : name_(name)
   { 
     if (first_) check() ;
@@ -26,8 +37,15 @@
     first_=false ;
   }
-  double CMemChecker::getMem(void)
-  {
-    if (first_) check() ;
-    if (!enabled_) return 0;
+  
+  // Return vector of memories amount :
+  //   - vector[0] : virtual memory (vsize) from /proc/self/stat
+  //   - vector[1] : resident set size (rss) from /proc/self/stat
+  std::vector<double> CMemChecker::getMem(void)
+  {
+    std::vector<double> memories(0);
+    memories.clear();
+    
+    if (first_) check() ;
+    if (!enabled_) return memories;
     std::ifstream statStream("/proc/self/stat",std::ios_base::in);
     std::string dummy ;
@@ -35,6 +53,102 @@
     unsigned long vsize; 
     statStream>>vsize ;
-    return vsize ;
-  }
+    memories.push_back(vsize);
+    unsigned long rss;
+    statStream>>rss ;
+    memories.push_back(rss*4096);
+    return memories ;
+  }
+  
+  // Return vector of memories amount, register values (see _init) as first call as reference :
+  //   - 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
+    unsigned long vsize; 
+    statStream>>vsize ;
+    if (vsize_init_==0) {
+      vsize_init_ = vsize;
+      time_init_=MPI_Wtime();
+    }
+    vsize -= vsize_init_;
+    memories.push_back(vsize);
+
+    // 2 - RSS
+    unsigned long 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 )
+  {
+    if ( !CXios::logMemory ) return ;
+
+    int rk = 0;
+    MPI_Comm_rank( MPI_COMM_WORLD, &rk );
+    std::string logName("xios_memory_"+std::to_string(rk)+".csv");
+    vector<double> mem = getMemories();
+    if (!mem[0]) {
+      fout_.open( logName );
+      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[0]/1024./1024.
+          << "," << mem[1]/1024./1024.
+          << "," << mem[2]/1024.
+          << std::endl;
+
+    if ((MPI_Wtime()-time_init_)>flush_counter_*600.)
+    {
+      fout_.flush();
+      flush_counter_++;
+    }
+    
+    if (finalizeLog)
+    {
+      fout_.close();
+    }
+  }
+
   
   void CMemChecker::suspend(void)
@@ -42,5 +156,13 @@
     if (first_) check() ;
     if (!enabled_) return ;
-    if (!suspended_) cumulatedMem_ += getMem() - lastMem_;
+    if (!suspended_)
+    {
+      vector<double> mem = getMem();
+      cumulatedMem_.resize( mem.size() );
+      for (int i=0;i<mem.size() ; i++)
+      {
+        cumulatedMem_[i] += mem[i] - lastMem_[i];
+      }
+    }
     suspended_ = true;
   }
@@ -50,20 +172,30 @@
     if (first_) check() ;
     if (!enabled_) return ;
-    if (suspended_) lastMem_ = getMem();
+    if (suspended_)
+    {
+      vector<double> mem = getMem();
+      lastMem_.resize( mem.size() );
+      for (int i=0;i<mem.size() ; i++)
+      {
+        lastMem_[i] = mem[i];
+      }
+    }
     suspended_ = false;
   }
-  
+
   void CMemChecker::reset(void)
   {
     if (first_) check() ;
     if (!enabled_) return ;
-    cumulatedMem_ = 0.;
+    cumulatedMem_.clear();
     suspended_ = true;
   }
   
-  double CMemChecker::getCumulatedMem(void)
-  {
-    if (first_) check() ;
-    if (!enabled_) return 0;
+  std::vector<double> CMemChecker::getCumulatedMem(void)
+  {
+    std::vector<double> memories;
+    memories.clear();
+    if (first_) check() ;
+    if (!enabled_) return memories;
     return cumulatedMem_;
   }
@@ -93,11 +225,14 @@
     for(std::map<std::string,CMemChecker>::iterator it=allMemChecker_.begin();it!=allMemChecker_.end();++it)
     {  
-      strOut<<"MemChecker : "<<it->first<<"    -->   consumed memory : " ;
-      double mem=it->second.getCumulatedMem() ;
-      if (mem>=Tb) strOut<< mem / Tb<<" Tb"<<std::endl ;
-      else if (mem>=Gb) strOut<< mem / Gb<<" Gb"<<std::endl ;
-      else if (mem>=Mb) strOut<< mem / Mb<<" Mb"<<std::endl ;
-      else if (mem>=Kb) strOut<< mem / Kb<<" Kb"<<std::endl ;
-      else strOut<< mem <<" bytes"<<std::endl ;
+      vector<double> mem=it->second.getCumulatedMem() ;
+      if (mem.size()>0)
+      {
+        strOut<<"MemChecker : "<<it->first<<"    -->   consumed memory : " ;      
+        if ((fabs(mem[0])>=Tb)||(fabs(mem[1])>=Tb)) strOut<< mem[0] / Tb<<" Tb - "<<mem[1] / Tb<<" Tb"<<std::endl ;
+        else if ((fabs(mem[0])>=Gb)||(fabs(mem[1])>=Gb)) strOut<< mem[0] / Gb<<" Gb - "<<mem[1] / Gb<<" Gb"<<std::endl ;
+        else if ((fabs(mem[0])>=Mb)||(fabs(mem[1])>=Mb)) strOut<< mem[0] / Mb<<" Mb - "<<mem[1] / Mb<<" Mb"<<std::endl ;
+        else if ((fabs(mem[0])>=Kb)||(fabs(mem[1])>=Kb)) strOut<< mem[0] / Kb<<" Kb - "<<mem[1] / Kb<<" Kb"<<std::endl ;
+        else strOut<< mem[0] <<" bytes - "<<mem[1] <<" bytes"<<std::endl ;
+      }
     }
     return strOut.str() ;
Index: XIOS3/branches/xios-3.0-beta/src/mem_checker.hpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/mem_checker.hpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/mem_checker.hpp	(revision 2427)
@@ -4,4 +4,6 @@
 #include <string>
 #include <map>
+#include <fstream>
+#include <vector>
 
 namespace xios
@@ -14,6 +16,8 @@
       void resume(void);
       void reset(void);
-      double getCumulatedMem(void);
-      static double getMem(void);
+      std::vector<double> getCumulatedMem(void);
+      static std::vector<double> getMem(void);
+      static std::vector<double> getMemories(void);
+      static void logMem( std::string id, bool finalizeLog = false );
       static CMemChecker& get(std::string name);
       static std::string getAllCumulatedMem(void) ;
@@ -23,6 +27,6 @@
     private:
       static void check(void) ;
-      double cumulatedMem_;
-      double lastMem_;
+      std::vector<double> cumulatedMem_;
+      std::vector<double> lastMem_;
       bool suspended_;
       std::string name_;
@@ -32,4 +36,11 @@
       static bool first_ ;
       static bool enabled_ ;
+
+      static double vsize_init_;
+      static double rss_init_;
+      static double vmhwm_init_;
+      static double time_init_;
+      static std::ofstream fout_;
+      static int flush_counter_;
   };
 }
Index: XIOS3/branches/xios-3.0-beta/src/node/context.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/node/context.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/node/context.cpp	(revision 2427)
@@ -17,4 +17,5 @@
 #include "xios_spl.hpp"
 #include "timer.hpp"
+#include "mem_checker.hpp"
 #include "memtrack.hpp"
 #include <limits>
@@ -873,4 +874,6 @@
    TRY
    {
+     CMemChecker::logMem( "CContext::closeDefinition" );
+
      CTimer::get("Context : close definition").resume() ;
      
@@ -1154,4 +1157,5 @@
 
      CTimer::get("Context : close definition").suspend() ;
+     CMemChecker::logMem( "CContext::closeDefinition_END" );
   }
   CATCH_DUMP_ATTR
@@ -2102,4 +2106,5 @@
           garbageCollector.invalidate(calendar->getCurrentDate());
         }
+        CMemChecker::logMem( "CContext::updateCalendar_"+std::to_string(step) );
       }
       else if (prevStep == step)
Index: XIOS3/branches/xios-3.0-beta/src/server.cpp
===================================================================
--- XIOS3/branches/xios-3.0-beta/src/server.cpp	(revision 2426)
+++ XIOS3/branches/xios-3.0-beta/src/server.cpp	(revision 2427)
@@ -13,4 +13,5 @@
 #include "tracer.hpp"
 #include "timer.hpp"
+#include "mem_checker.hpp"
 #include "event_scheduler.hpp"
 #include "string_tools.hpp"
@@ -159,4 +160,6 @@
       CServer::openInfoStream(CXios::serverFile);
       CServer::openErrorStream(CXios::serverFile);
+
+      CMemChecker::logMem( "CServer::initialize" );
 
       /////////////////////////////////////////
@@ -429,4 +432,5 @@
       CXios::getMpiGarbageCollector().release() ; // release unfree MPI ressources
 
+      CMemChecker::logMem( "CServer::finalize", true );
       if (!is_MPI_Initialized)
       {
@@ -438,4 +442,5 @@
       report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ;
       report(100)<<CTimer::getAllCumulatedTime()<<endl ;
+      report(100)<<CMemChecker::getAllCumulatedMem()<<endl ;
       
       CWorkflowGraph::drawWorkFlowGraph_server();
