Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a i-am-everywhere leak
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 21 Mar 2016 22:12:43 +0000 (23:12 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 21 Mar 2016 22:12:43 +0000 (23:12 +0100)
 + delete pimpl_netcard when freeing a host
 + As the netcard of a physical host is shared by VMs running on it,
   it leads to double frees.
 + A solution is to explicity destroy the VMs when they are not needed
   anymore.
If one doesn't like it, feel free to simplify the VM stuff ;)

examples/java/cloud/Master.java
examples/java/cloud/energy/EnergyVMRunner.java
examples/msg/energy/vm/vm.c
src/s4u/s4u_host.cpp

index c1e1373..211b17b 100644 (file)
@@ -80,6 +80,7 @@ public class Master extends Process {
 
     for (int i = 0; i < vms.size(); i++) {
       vms.get(i).shutdown();
+      vms.get(i).finalize();
     }
     Msg.info("Master done.");
   }
index 17d8e09..34d2cf5 100644 (file)
@@ -67,5 +67,7 @@ public class EnergyVMRunner extends Process {
 
     vmHost1.shutdown(); 
     vmHost3.shutdown(); 
+    vmHost1.finalize(); 
+    vmHost3.finalize(); 
   }
 }
index 96175d3..34383f1 100644 (file)
@@ -51,6 +51,8 @@ static int dvfs(int argc, char *argv[])
 
   MSG_vm_shutdown(vm_host1);
   MSG_vm_shutdown(vm_host3);
+  MSG_vm_destroy(vm_host1);
+  MSG_vm_destroy(vm_host3);
 
   return 0;
 }
index 892337c..d28b2a6 100644 (file)
@@ -43,6 +43,7 @@ Host::Host(const char* name)
 
 Host::~Host() {
   delete pimpl_cpu;
+  delete pimpl_netcard;
   delete mounts;
 }