Index: /XIOS3/trunk/scripts/plotly_memory.js
===================================================================
--- /XIOS3/trunk/scripts/plotly_memory.js	(revision 2419)
+++ /XIOS3/trunk/scripts/plotly_memory.js	(revision 2419)
@@ -0,0 +1,83 @@
+
+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,
+ 	    memory: +d.memory
+ 	};
+    }, 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 < 3 ; 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].memory ) // y axis
+	transData[2].push( xios_mem_data[i].event )  // labels
+    };
+    //console.log(transData[0]);
+
+    var data = [];
+    var result = {
+	x: transData[0],
+	y: transData[1],
+	type: 'scatter',
+	mode: 'markers',
+	text: transData[2],
+    };
+    data.push(result);
+
+    var layout = {
+	title: "Memory consumption",
+	xaxis: {
+	    title: "Time (ms)",
+	},
+	yaxis: {
+	    title: "Memory (Mo)",
+	}
+    };
+
+    Plotly.newPlot('myDiv', data, layout);
+    
+}
Index: /XIOS3/trunk/scripts/xios_memory.html
===================================================================
--- /XIOS3/trunk/scripts/xios_memory.html	(revision 2419)
+++ /XIOS3/trunk/scripts/xios_memory.html	(revision 2419)
@@ -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/trunk/src/cxios.cpp
===================================================================
--- /XIOS3/trunk/src/cxios.cpp	(revision 2418)
+++ /XIOS3/trunk/src/cxios.cpp	(revision 2419)
@@ -157,5 +157,5 @@
   void CXios::clientFinalize(void)
   {
-     CMemChecker::logMem("CXios::clientFinalize", true);
+     CMemChecker::logMem("CXios::clientFinalize");
 
      CClient::finalize() ;
Index: /XIOS3/trunk/src/mem_checker.cpp
===================================================================
--- /XIOS3/trunk/src/mem_checker.cpp	(revision 2418)
+++ /XIOS3/trunk/src/mem_checker.cpp	(revision 2419)
@@ -77,10 +77,9 @@
     int rk = 0;
     MPI_Comm_rank( MPI_COMM_WORLD, &rk );
-    std::string logName("mem_"+std::to_string(rk)+".js");
+    std::string logName("xios_memory_"+std::to_string(rk)+".csv");
     double mem = getMemRSS();
     if (!mem) {
       fout.open( logName );
-      fout << "function get_xios_mem_data() {" << std::endl;
-      fout << "  return [" << std::endl;
+      fout << "time,event,memory" << std::endl;
     }
     else
@@ -90,11 +89,6 @@
 
     // Time format : YYYY-MM-DD HH:MM:SS.XXX -> seconds * 1000.
-    fout << "        [ " << (MPI_Wtime()-time_init_)*1000. << ", \"" << id << "\"," << mem/1000000. << "]," << std::endl;
+    fout << (MPI_Wtime()-time_init_)*1000. << "," << id << "," << mem/1000000. << std::endl;
 
-    if (finalizeLog)
-    {
-      fout << "  ];" << std::endl;
-      fout << "}" << std::endl;
-    }
     fout.close();
   }
Index: /XIOS3/trunk/src/node/context.cpp
===================================================================
--- /XIOS3/trunk/src/node/context.cpp	(revision 2418)
+++ /XIOS3/trunk/src/node/context.cpp	(revision 2419)
@@ -1163,5 +1163,5 @@
 
      CTimer::get("Context : close definition").suspend() ;
-     CMemChecker::logMem( "CContext::closeDefinition END" );
+     CMemChecker::logMem( "CContext::closeDefinition_END" );
   }
   CATCH_DUMP_ATTR
Index: /XIOS3/trunk/src/server.cpp
===================================================================
--- /XIOS3/trunk/src/server.cpp	(revision 2418)
+++ /XIOS3/trunk/src/server.cpp	(revision 2419)
@@ -434,5 +434,5 @@
       CXios::getMpiGarbageCollector().release() ; // release unfree MPI ressources
 
-      CMemChecker::logMem( "CServer::finalize", true );
+      CMemChecker::logMem( "CServer::finalize" );
       if (!is_MPI_Initialized)
       {
