Increase Memory Consumption - EnergyModel

211 views
Skip to first unread message

Giovanna Garcia

unread,
Nov 22, 2018, 12:23:30 PM11/22/18
to ns-3-users
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.
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"




Using the BasicEnergySource:
/* 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));

With reduced nodes:
// configure cli
  m_cli
.Create(5);

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):
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 the nodes:
  // configure cli
  m_cli
.Create(20);

Memory increase:

It reaches the 84% of memory and starts to use the swap memory.


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 and EnergyModule 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.
main.cc
massif_uav_source.out
test-bed.cc
test-bed.h
uav-energy-source.cc
uav-energy-source.h
uav-energy-source-helper.cc
uav-energy-source-helper.h

teodoro saavedra

unread,
Jun 29, 2019, 5:51:53 PM6/29/19
to ns-3-users
i have a similar problem, did you find a solution? 
Reply all
Reply to author
Forward
0 new messages