From: Toby C. <tco...@pl...> - 2009-04-08 19:32:18
|
Try running with fewer iterations, even 10 iterations should be enough for you to see where any memory leaks are in the valgrind output. Toby 2009/4/8 Joao Duro <j....@sh...> > Hi Toby, > > valgrind could only give me this information in the output terminal: > ($valgrind -v --leak-check=yes ./stest) > > **************** > Simulation n. 525 > **************** > [Loading simple.world][Include pioneer.inc][Include map.inc][Include > sick.inc]==24813== > Valgrind's memory management: out of memory: > newSuperblock's request for 4194304 bytes failed. > 1008295936 bytes have already been allocated. > Valgrind cannot continue. Sorry. > > There are several possible reasons for this. > - You have some kind of memory limit in place. Look at the > output of 'ulimit -a'. Is there a limit on the size of > virtual memory or address space? > - You have run out of swap space. > - Valgrind has a bug. If you think this is the case or you are > not sure, please let us know and we'll try to fix it. > Please note that programs can take substantially more memory than > normal when running under Valgrind tools, eg. up to twice or > more, depending on the tool. On a 64-bit machine, Valgrind > should be able to make use of up 32GB memory. On a 32-bit > machine, Valgrind should be able to use all the memory available > to a single process, up to 4GB if that's how you have your > kernel configured. Most 32-bit Linux setups allow a maximum of > 3GB per process. > > Whatever the reason, Valgrind cannot continue. Sorry. > > > Its funny that vagrind went out of memory to check my memory leak > (controversial). > And yes I do have a memory limit (using ulimit) otherwise my system > would get unstable and the program would never terminate. (Only a manual > reboot will solve it). Did you think I should run valgrind without the > memory restriction?! > > The complete source code of my program is here: > http://pastebin.com/f568d186b > > Maybe will also be usefull (a backtrace with gdb is here): > http://pastebin.com/f63551df4 > > Sorry for the trouble, > Regards, > Joao > > > On Tue, 2009-04-07 at 20:55 +0100, Toby Collett wrote: > > valgrind can be used to trace this. It will slow the system down > > somewhat, but running > > > > valgrind -v --leak-check=yes player <player args here> > > > > Will produce a detailed report of leaked memory when you terminate the > > application. > > > > 2009/4/7 Joao Duro <j....@sh...> > > Hi Brain, > > > > Placing fclose(file) in worldfile.cc in line 185 (for > > Load(...) and line 563 (for LoadTokenInclude(..)) solve this > > error. > > > > However another one came! :( > > > > I realise that the process is constantly incrementing the > > memory that is consuming and after several minutes the whole > > system went unstable. > > > > So I decide to limit the amount of memory that the process is > > actually allowed to use using a simple bash command: > > ulimit -d 1000000 -m 1000000 -v 1000000 > > > > After the threshold has been achieved the process exist with > > the following error: > > > > .... > > > > **************** > > Simulation n. 1157 > > **************** > > [Loading simple.world][Include pioneer.inc][Include > > map.inc][Include sick.inc][Load time 0.112sec] > > > > searching for type 1 in model r0 type 4 > > searching for type 1 in model r0.ranger:0 type 3 > > searching for type 1 in model r0.laser:0 type 1 > > searching for type 1 in model r1 type 4 > > searching for type 1 in model r1.ranger:0 type 3 > > searching for type 1 in model r1.laser:0 type 1 > > -6.5 -6.5 > > -6.5 -7.5 > > time: 1 > > time: 1 > > time: 2 > > time: 2 > > time: 3 > > time: 3 > > time: 4 > > time: 4 > > time: 5 > > time: 5 > > time: 6 > > time: 6 > > time: 7 > > time: 7 > > time: 8 > > time: 8 > > time: 9 > > time: 9 > > time: 10 > > time: 10 > > time: 11 > > time: 11 > > time: 12 > > time: 12 > > time: 13 > > time: 13 > > time: 14 > > time: 14 > > time: 15 > > time: 15 > > time: 16 > > time: 16 > > time: 17 > > time: 17 > > time: 18 > > time: 18 > > -5.36863 -5.36863 > > -5.36863 -6.36863 > > unsubscribe from r0 0 > > unsubscribe from r0.laser:0 0 > > unsubscribe from r1 0 > > unsubscribe from r1.laser:0 0 > > **************** > > > > Simulation n. 1158 > > **************** > > [Loading simple.world][Include pioneer.inc][Include > > map.inc][Include sick.inc] > > > > GLib-ERROR **: (NULL) message > > aborting... > > Aborted > > > > > > Maybe there is some dynamically allocated space that is not > > being free by the Stage members functions. > > I am not an expert in Stage development source code! > > Could someone have a look if there is possibility to trace and > > to improve this benchmark tool ?! > > > > Regards, > > Joao > > > > > > On Mon, 2009-04-06 at 22:57 +0100, Brian Gerkey wrote: > > > Looks like Stage is being a little loose with its management > > of file > > > descriptors. I would guess that fclose(file) should be > > called in > > > WorldFile::Load(), after LoadTokens(), somewhere around > > worldfile.cc: > > > 185. I haven't tried this. > > > > > > brian. > > > > > > On Apr 6, 2009, at 2:43 PM, Joao Duro wrote: > > > > > > > Hey I am using Stage 3.0.1 as a standalone C++ library. > > > > I am trying to run the same simulation many times. > > > > After 256 simulation I am getting always the same error. > > > > I am only using two robots with lasers and they only go > > straight > > > > during > > > > 18 seconds. > > > > > > > > The code that perform this is here: > > > > http://pastebin.com/f27f9937e > > > > > > > > Here is a quickshot of what it happens in the terminal: > > > > > > > > $stestsimple simple.world 2 > > > > > > > > ...... > > > > > > > > > > > **************************************************************************** > > > > > > > **************************************************************************** > > > > > > > **************************************************************************** > > > > > > > > **************** > > > > Simulation n. 255 > > > > **************** > > > > [Loading simple.world][Include pioneer.inc][Include > > map.inc][Include > > > > sick.inc][Load time 0.113sec] > > > > searching for type 1 in model r0 type 4 > > > > searching for type 1 in model r0.ranger:0 type 3 > > > > searching for type 1 in model r0.laser:0 type 1 > > > > searching for type 1 in model r1 type 4 > > > > searching for type 1 in model r1.ranger:0 type 3 > > > > searching for type 1 in model r1.laser:0 type 1 > > > > -6.5 -6.5 > > > > -6.5 -7.5 > > > > time: 1 > > > > time: 1 > > > > time: 2 > > > > time: 2 > > > > time: 3 > > > > time: 3 > > > > time: 4 > > > > time: 4 > > > > time: 5 > > > > time: 5 > > > > time: 6 > > > > time: 6 > > > > time: 7 > > > > time: 7 > > > > time: 8 > > > > time: 8 > > > > time: 9 > > > > time: 9 > > > > time: 10 > > > > time: 10 > > > > time: 11 > > > > time: 11 > > > > time: 12 > > > > time: 12 > > > > time: 13 > > > > time: 13 > > > > time: 14 > > > > time: 14 > > > > time: 15 > > > > time: 15 > > > > time: 16 > > > > time: 16 > > > > time: 17 > > > > time: 17 > > > > time: 18 > > > > time: 18 > > > > -5.36863 -5.36863 > > > > -5.36863 -6.36863 > > > > unsubscribe from r0 0 > > > > unsubscribe from r0.laser:0 0 > > > > unsubscribe from r1 0 > > > > unsubscribe from r1.laser:0 0 > > > > **************** > > > > Simulation n. 256 > > > > **************** > > > > [Loading simple.world][Include pioneer.inc]err: unable to > > open include > > > > file /home/jduro/Desktop/workspace/stest/./pioneer.inc : > > Too many open > > > > files > > (/home/jduro/playerstage/Stage-3.0.1-Source/libstage/ > > > > worldfile.cc > > > > LoadTokenInclude) > > > > [Load time 0.001sec] > > > > warn: lookup of model name r0: no matching name > > > > > > (/home/jduro/playerstage/Stage-3.0.1-Source/libstage/world.cc > > > > GetModel) > > > > stest: ../stestsimple.cpp:45: int main(int, char**): > > Assertion > > > > `robots[i].position' failed. > > > > Aborted > > > > > > > > > > > > > > > **************************************************************************** > > > > > > > **************************************************************************** > > > > > > > **************************************************************************** > > > > > > > > In order to close the opened files by > > world->Load( worldfile ); why is > > > > "world->UnLoad();" not enough?! If not what else is > > required ?! > > > > > > > > Regards, > > > > Joao > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > This SF.net email is sponsored by: > > > > High Quality Requirements in a Collaborative Environment. > > > > Download a free trial of Rational Requirements Composer > > Now! > > > > http://p.sf.net/sfu/www-ibm-com > > > > _______________________________________________ > > > > Playerstage-users mailing list > > > > Pla...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > This SF.net email is sponsored by: > > > High Quality Requirements in a Collaborative Environment. > > > Download a free trial of Rational Requirements Composer Now! > > > http://p.sf.net/sfu/www-ibm-com > > > _______________________________________________ > > > Playerstage-users mailing list > > > Pla...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by: > > High Quality Requirements in a Collaborative Environment. > > Download a free trial of Rational Requirements Composer Now! > > http://p.sf.net/sfu/www-ibm-com > > _______________________________________________ > > Playerstage-users mailing list > > Pla...@li... > > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > > > > > > > > > -- > > This email is intended for the addressee only and may contain > > privileged and/or confidential information > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Playerstage-users mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > -- This email is intended for the addressee only and may contain privileged and/or confidential information |