Hello,
Mine simulation where I am using the WifiRadioEnergyModel together with the EnergyModel is with an increase memory consumption.
I have reduced the scenario and the number of nodes, inserted the WifiRadioEnergyModel just in one node and still it is having an increase memory consumption.
I am using the NS3.29 version, and attached those files in here and they can be found here too: https://github.com/ggarciabas/wifi_energy_results
I have created an EnergySource called uav-energy-source, just a reduced and modified structure from BasicEnergySource.
When I execute with the UavEnergySource the simulation is easily ended but, with a high memory consumption, but it ends!
file: test-bed.cc
/* Mine energy source */
UavEnergySourceHelper sourceHelper;
sourceHelper.Set("ScenarioName", StringValue(m_scenarioName));
sourceHelper.Set("UavEnergySourceInitialEnergy", DoubleValue(m_initialEnergyJ)); // Joules
EnergySourceContainer sources = sourceHelper.Install(m_uavs.Get(0)); // install source
// DynamicCast<UavEnergySource>(sources.Get(0))->Start(); --- not used in this simulation
// Energy sources
// EnergySourceContainer sources;
// BasicEnergySourceHelper basicSourceHelper;
// basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (m_initialEnergyJ));
// basicSourceHelper.Set ("BasicEnergySupplyVoltageV", DoubleValue (3.3));
// sources = basicSourceHelper.Install(m_uavs.Get(0));
// configure cli
m_cli.Create(20);
I have used the Valgrind, file massif_uav_source.out, but the htop tool showed approx 47% of memory (5.64GB)
Execution line: ./waf --run wifi_energy_results --command-template="valgrind --tool=massif %s --Protocol=1 --Scenario=1 --Seed=289265"
![image](https://user-images.githubusercontent.com/3122199/48915248-2387a580-ee65-11e8-83e5-9f0986e4f9d9.png)
When I use the BasicEnergySource it reaches the 92% of memory and starts to use the swap memory.
With reduced nodes:
// configure cli
m_cli.Create(5);
and BasicEenrgySource:
/* Mine energy source */
// UavEnergySourceHelper sourceHelper;
// sourceHelper.Set("ScenarioName", StringValue(m_scenarioName));
// sourceHelper.Set("UavEnergySourceInitialEnergy", DoubleValue(m_initialEnergyJ)); // Joules
// sources = sourceHelper.Install(m_uavs.Get(0)); // install source
//// DynamicCast<UavEnergySource>(sources.Get(0))->Start(); --- not used in this simulation
// Energy sources
EnergySourceContainer sources;
BasicEnergySourceHelper basicSourceHelper;
basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (m_initialEnergyJ));
basicSourceHelper.Set ("BasicEnergySupplyVoltageV", DoubleValue (3.3));
sources = basicSourceHelper.Install(m_uavs.Get(0));
I have tried to use the valgrind tool but I got this error:
./waf --run wifi_energy_results --command-template="valgrind --tool=massif %s --Protocol=1 --Scenario=1 --Seed=289265"
Waf: Entering directory `/home/ggarciabas/ns3/build'
Waf: Leaving directory `/home/ggarciabas/ns3/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (2.281s)
==10565== Massif, a heap profiler
==10565== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==10565== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==10565== Command: /home/ggarciabas/ns3/build/scratch/wifi_energy_results/wifi_energy_results --Protocol=1 --Scenario=1 --Seed=289265
==10565==
==10565==
==10565== Process terminating with default action of signal 11 (SIGSEGV)
==10565== Access not within mapped region at address 0x118EA000
==10565== at 0xD732BB1: ns3::Object::~Object() (object.cc:114)
==10565== by 0xC0A4AC1: ns3::EnergySourceContainer::~EnergySourceContainer() (energy-source-container.cc:45)
==10565== by 0x13DF5D: ns3::TestBed::ConfigureScenario() (test-bed.cc:389)
==10565== by 0x13459C: ns3::TestBed::Run() (test-bed.cc:129)
==10565== by 0x130F1B: main (main.cc:49)
==10565== If you believe this happened as a result of a stack
==10565== overflow in your program's main thread (unlikely but
==10565== possible), you can try to increase the size of the
==10565== main thread stack using the --main-stacksize= flag.
==10565== The main thread stack size used in this run was 8388608.
==10565==
Command ['valgrind', '--tool=massif', '/home/ggarciabas/ns3/build/scratch/wifi_energy_results/wifi_energy_results', '--Protocol=1', '--Scenario=1', '--Seed=289265'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
Running it under GDB no problems are found, just 50% of memory (~6GB):
./waf --run wifi_energy_results --command-template="gdb --args %s --Protocol=1 --Scenario=1 --Seed=289265"
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/ggarciabas/ns3/build/scratch/wifi_energy_results/wifi_energy_results...done.
(gdb) r
Starting program: /home/ggarciabas/ns3/build/scratch/wifi_energy_results/wifi_energy_results --Protocol=1 --Scenario=1 --Seed=289265
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 10256) exited normally]
(gdb)
When I increase just 5 nodes
// configure cli
m_cli.Create(10);
Fast increase of memory:
![image](https://user-images.githubusercontent.com/3122199/48915479-f091e180-ee65-11e8-82f9-74a4ee272031.png)
![image](https://user-images.githubusercontent.com/3122199/48915511-14552780-ee66-11e8-8311-0af5ed82d928.png)
![image](https://user-images.githubusercontent.com/3122199/48915743-ec19f880-ee66-11e8-9541-05f7d588c78e.png)
When I increase the nodes
// configure cli
m_cli.Create(20);
Memory increase:
![image](https://user-images.githubusercontent.com/3122199/48915911-8aa65980-ee67-11e8-832f-2dac065bac8e.png)
![image](https://user-images.githubusercontent.com/3122199/48915970-b0336300-ee67-11e8-9b86-7e063e8e13d9.png)
![image](https://user-images.githubusercontent.com/3122199/48916097-1324fa00-ee68-11e8-8f74-5802d8ab6106.png)
![image](https://user-images.githubusercontent.com/3122199/48916190-7878eb00-ee68-11e8-8d53-f7f1e4dc578e.png)
![image](https://user-images.githubusercontent.com/3122199/48916286-c392fe00-ee68-11e8-8e3a-e9b2c2d4f13d.png)
![image](https://user-images.githubusercontent.com/3122199/48916344-09e85d00-ee69-11e8-9f91-7a7b7c97bf44.png)
![image](https://user-images.githubusercontent.com/3122199/48916389-4451fa00-ee69-11e8-806d-e2b92d0f5551.png)
![image](https://user-images.githubusercontent.com/3122199/48916491-b0ccf900-ee69-11e8-8c5c-35f39561efdd.png)
I would like to know if someone already had this problem, because I have searched about this and found nothing.
If I remove the structure from the WifiRadioEnergyModel the simulation do not use 1% of memory.
This is a normal problem or am I doing some configuration wrong?
Thanks,
Best regards,
Giovanna Garcia.