<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yiv3203938371"><div id="yui_3_16_0_1_1452764539431_8335"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1452764539431_8334"><div id="yiv3203938371yui_3_16_0_1_1452764539431_4758"><span id="yiv3203938371yui_3_16_0_1_1452764539431_6649">Hi All,</span></div><div id="yiv3203938371yui_3_16_0_1_1452764539431_4758"><span id="yiv3203938371yui_3_16_0_1_1452764539431_5219">I'm attaching my whole conversation with David and files below.</span></div><div id="yiv3203938371yui_3_16_0_1_1452764539431_4758">Could you please help with solving this issue?</div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_4758">It's a strange bug which causes huge consumption of RAM and gives me <span class="yiv3203938371" id="yiv3203938371yui_3_16_0_1_1452764539431_5412" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"> this error message</span></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_4758"><span class="yiv3203938371" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_4758"><span class="yiv3203938371" id="yiv3203938371yui_3_16_0_1_1452764539431_5414" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"> <i id="yiv3203938371yui_3_16_0_1_1452764539431_5514"> /terminate called after throwing an instance of 'std::bad_alloc'/</i></span></div><i id="yiv3203938371yui_3_16_0_1_1452764539431_6027"><span class="yiv3203938371" id="yiv3203938371yui_3_16_0_1_1452764539431_5416" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"> / what(): std::bad_alloc/</span><br clear="none" class="yiv3203938371" id="yiv3203938371yui_3_16_0_1_1452764539431_5418" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"></i><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421"><span id="yiv3203938371yui_3_16_0_1_1452764539431_5422" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><i id="yiv3203938371yui_3_16_0_1_1452764539431_6028"> /Przerwane (core dumped)/</i></span></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421"><br clear="none"></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421">My visualization doesn't even start but it is the smallest problem.</div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421"><br></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421">I run benchmark simulation just to check if is everything all right with my Gate and it all works (benchmarkSPECT.mac with visualization works fine).</div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421"><br></div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421">I'm working on ubuntu 14.04 LTS / Geant4.9.6.p04 / Gate_v7.0/ ROOT 5.34.34.</div><div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_5421"><font id="yiv3203938371yui_3_16_0_1_1452764539431_6164" size="3">On<font id="yiv3203938371yui_3_16_0_1_1452764539431_6137" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif"> machine with i5VPRO/2.4GHz/8GB/128 SSD. </font></font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font size="3"><br></font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font id="yiv3203938371yui_3_16_0_1_1452764539431_6165" size="3">Can anybody help me with this issue?</font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font size="3">I'll be very thankful.</font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font size="3"><br></font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font size="3" id="yui_3_16_0_1_1452764539431_9395">Best Regards&Thanks</font></div><div class="yiv3203938371qtdSeparateBR" id="yiv3203938371yui_3_16_0_1_1452764539431_4571"><font size="3" id="yui_3_16_0_1_1452764539431_9396">Michał Knap<br clear="none" id="yiv3203938371yui_3_16_0_1_1452764539431_6140"></font><br clear="none"></div> </div></div></div><div class=".yiv3203938371yahoo_quoted" id="yui_3_16_0_1_1452764539431_8735"> <div id="yiv3203938371yui_3_16_0_1_1452764539431_4563" style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div id="yiv3203938371yui_3_16_0_1_1452764539431_4562" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr" id="yiv3203938371yui_3_16_0_1_1452764539431_4561"><font id="yiv3203938371yui_3_16_0_1_1452764539431_4560" size="2" face="Arial"> 13:07 czwartek, 2016-1-14, David Boersma <david.boersma@physics.uu.se> napisał(a):<br clear="none"></font></div> <br clear="none"><br clear="none"> <div class="qtdSeparateBR" id="yui_3_16_0_1_1452764539431_9099"><br><br></div><div class="yiv3203938371yqt8973136228" id="yiv3203938371yqt15475"><div class="yiv3203938371y_msg_container" id="yiv3203938371yui_3_16_0_1_1452764539431_4572">Hi,<br clear="none"><br clear="none">All:<br clear="none"><br clear="none">Could other people please have a look at Michał's problem? I could run <br clear="none">his macro (see his previous mail) and Gate indeed consumes excessive <br clear="none">amounts of RAM, but it is not clear to me why that happens. See below <br clear="none">for my observations. I have to work on other things now.<br clear="none"><br clear="none"><br clear="none">Michał:<br clear="none"><br clear="none">Yes, I could run your macro. I disabled all the lines with "/vis" in <br clear="none">them, ran the command "Gate ./minigamma1pointsourceoncollimator.mac" and <br clear="none">then observed in a separate window with "htop" how things were going, <br clear="none">resource-wise.<br clear="none"><br clear="none">I ran this on a machine with 16 GiB of RAM, Ubuntu 14.04, Geant <br clear="none">4.9.6.p04. It took about a minute to fill up all the RAM, and then it <br clear="none">started to eat up the swap space. When it had eaten up 90% of the swap <br clear="none">space I killed the program (from within htop; I was not able to kill <br clear="none">Gate with ctrl-C).<br clear="none"><br clear="none">I think we can conclude that "something" in Gate is allocating too much <br clear="none">memory. It could be a spectacular memory leak, or it could be some <br clear="none">missconfigured component in your macro that causes excessive resource <br clear="none">consumption. For the latter hypothesis I looked at your macro for <br clear="none">suspicious things, but the most segmented thing I could find was the <br clear="none">"projection" output, and replacing 128*128 by 4*4 did not help at all. I <br clear="none">reduced the time slice from 1s to 0.001s and the time stop from 60s to <br clear="none">0.002s, but that did not seem to change anything either.<br clear="none"><br clear="none">Maybe there is some implicit/default setting that is wrong for your <br clear="none">application. I am not an imaging expert (I use gate for radiotherapy), <br clear="none">so maybe someone else has an idea.<br clear="none"><br clear="none">I ran it in "gdb" (the GNU debugger) and stopped the program by sending <br clear="none">it a signal, while it was eating memory, and checked with "bt" <br clear="none">(backtrace) in which function it was running at the moment I stopped it. <br clear="none">I repeated this several times and got different backtraces every time, <br clear="none">so this did not provide any useful hints for finding out which part of <br clear="none">the code is responsible.<br clear="none"><br clear="none">This is as far as I could get, and the problem is not yet solved. I hope <br clear="none">someone else on the list can take over to help you solve this. Maybe <br clear="none">someone should run it with "valgrind", but that can be pretty time <br clear="none">consuming, and maybe someone actually already knows, that would be much <br clear="none">more efficient.<br clear="none"><br clear="none">Good luck,<br clear="none">David B.<br clear="none"><br clear="none"><br clear="none">Den 13/01/2016 kl. 20:26, skrev Michal Knap:<br clear="none">> Hi David,<br clear="none">> It would be really great if you could take a look on my mac file.<br clear="none">> Please see the attachment.<br clear="none">> I'm a little bit confused about this bug.<br clear="none">><br clear="none">> I will try to try out your idea with much simplified version and will<br clear="none">> return with the results.<br clear="none">><br clear="none">> Thanks&Regards<br clear="none">> Michał Knap<br clear="none">><br clear="none">><br clear="none">><br clear="none">> 12:00 środa, 2016-1-13, David Boersma <<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a>><br clear="none">> napisał(a):<br clear="none">><br clear="none">><br clear="none">> Hi Michał,<br clear="none">><br clear="none">> On 2016-01-13 07:04, Michal Knap wrote:<br clear="none">> > Hi David,<br clear="none">> > I have only one version of Gate and Geant4 installed - Gate v7.0 and<br clear="none">> > Geant4.9.6.p04.<br clear="none">> ><br clear="none">> > I successfully run benchmark simulation - benchmarkSPECT, with or<br clear="none">> > without visualization.<br clear="none">> ><br clear="none">> > So it's somthing with my code i think. What can i disable/enable to fix<br clear="none">> > this bug?<br clear="none">><br clear="none">> If there is indeed something wrong with your code then we can only help<br clear="none">> you by looking at your code.<br clear="none">><br clear="none">> So, as I wrote in my previous mail, it would be nice if you could make a<br clear="none">> short and strongly simplified version of your macro which still crashes<br clear="none">> in the same way. Preferably it only uses input data from the examples<br clear="none">> and benchmarks. E.g. you define only a very crude geometry and a gamma<br clear="none">> source, and a number of primaries, no visualization. If that throws the<br clear="none">> same bad_alloc exception, then please send that to us, we can try to<br clear="none">> reproduce and tell you what's wrong. Of course it is possible that the<br clear="none">> problem disappears after you take out certain parts of the macro. If you<br clear="none">> can nail it down to one particular line or set of lines that makes the<br clear="none">> difference between crashing and not crashing, then quote those lines to<br clear="none">> us. That is less helpful the first option, but could still provide a hint.<br clear="none">><br clear="none">> David B.<br clear="none">><br clear="none">><br clear="none">> ><br clear="none">> > Best regards<br clear="none">> > Michał Knap<br clear="none">> ><br clear="none">> ><br clear="none">> > 18:11 wtorek, 2016-1-12, David Boersma <<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a>>><br clear="none">> > napisał(a):<br clear="none">> ><br clear="none">> ><br clear="none">> > Hi Michał,<br clear="none">> ><br clear="none">> > Some more simple questions:<br clear="none">> ><br clear="none">> > * Can you run macros from the example directory successfully, or do some<br clear="none">> > of them result in this same error?<br clear="none">> ><br clear="none">> ><br clear="none">> > * Do you have multiple versions of Geant4 and/or Root installed? If yes,<br clear="none">> > could you check with the following command:<br clear="none">> ><br clear="none">> > ldd $(which Gate)<br clear="none">> ><br clear="none">> > that your Gate executable gets indeed linked to the same versions as the<br clear="none">> > ones you configured during installation of Gate? If the versions do not<br clear="none">> > match: then fix your environment, or reinstall Gate (from scratch).<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > If these simple questions do not help, then I think the next step is to<br clear="none">> > make a minimalistic version of your macro that demonstrates the error<br clear="none">> > you are seeing and post it here on the list, so that other people have a<br clear="none">> > chance to reproduce this problem. Please also specify how you run the<br clear="none">> > Gate command (with which options).<br clear="none">> ><br clear="none">> > HTH,<br clear="none">> > David Boersma<br clear="none">> ><br clear="none">> > Den 12/01/2016 kl. 17:35, skrev Michal Knap:<br clear="none">> > > Hi David,<br clear="none">> > > I checked you idea but i use only 50-60% RAM memory.<br clear="none">> > > While i'm running simulation i do not use any other apps.<br clear="none">> > > Even browser is closed.<br clear="none">> > ><br clear="none">> > > I have intel i5 vPRO, 8GB RAM, 120 GB SSD<br clear="none">> > > Ubuntu 14.04 LTS, Geant4.9.6.p04,Gate7.0,Root 5.34.34<br clear="none">> > ><br clear="none">> > > Kind regards<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > 17:01 wtorek, 2016-1-12, David Boersma<br clear="none">> <<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a>><br clear="none">> > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:david.boersma@physics.uu.se" target="_blank" href="mailto:david.boersma@physics.uu.se">david.boersma@physics.uu.se</a>>>><br clear="none">> > > napisał(a):<br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > > Hi Michał,<br clear="none">> > ><br clear="none">> > > My first guess would be a memory problem. Could you check with some<br clear="none">> > > resource monitor ("top" or "htop" on linux, "Activity Monitory" on<br clear="none">> > > MacOSX) how much RAM is used on your machine, by which programs?<br clear="none">> > ><br clear="none">> > > It could be that other programs than GATE (e.g. a web browser) are<br clear="none">> using<br clear="none">> > > so much RAM that there is not enough available for your GATE<br clear="none">> > > application. Then this is easily solved by quitting those other<br clear="none">> programs.<br clear="none">> > ><br clear="none">> > > It could be that you configured GATE too optimistically, e.g. using a<br clear="none">> > > scoring volume with too many voxels. Then you should either use a more<br clear="none">> > > modest configuration, or run on a bigger machine.<br clear="none">> > ><br clear="none">> > > There are many other possible causes, but these are the easiest<br clear="none">> ones, I<br clear="none">> > > can think of. It would be good if you could tell us whether these are<br clear="none">> > > already ruled out.<br clear="none">> > ><br clear="none">> > > Also: when reporting problems and asking for help, it could be helpful<br clear="none">> > > if you would add some basic specs about the OS (+version) and the<br clear="none">> > > hardware (in particular how much RAM your have). Which version of GATE<br clear="none">> > > are you using, with which version of Geant4? How did you install<br clear="none">> it? Did<br clear="none">> > > you install it recently or long ago?<br clear="none">> > ><br clear="none">> > > HTH,<br clear="none">> > > David<br clear="none">> > ><br clear="none">> > > Den 12/01/2016 kl. 15:55, skrev Michal Knap:<br clear="none">> > > > Hi All,<br clear="none">> > > > As i'm trying to simulate a minigammacamera i'm getting this error<br clear="none">> > > message.<br clear="none">> > > > I still do not know how to fix this.<br clear="none">> > > > Can anybody know what is wrong?<br clear="none">> > > > //<br clear="none">> > > > /[Acquisition-0] Slice 0 from 0 to 37.5 s [slice=37.5 s], final<br clear="none">> > stop at<br clear="none">> > > > 150 s./<br clear="none">> > > > /terminate called after throwing an instance of 'std::bad_alloc'/<br clear="none">> > > > / what(): std::bad_alloc/<br clear="none">> > > > /Przerwane (core dumped)/<br clear="none">> > > > /<br clear="none">> > > > /<br clear="none">> > > > I'll be very thankful for any help.<br clear="none">> > > ><br clear="none">> > > > Thanks in advance<br clear="none">> > > ><br clear="none">> > > > Kind regards<br clear="none">> > > > Michał Knap<br clear="none">> > ><br clear="none">> > > ><br clear="none">> > > ><br clear="none">> > > > _______________________________________________<br clear="none">> > > > Gate-users mailing list<br clear="none">> > > > <a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" id="yiv3203938371yui_3_16_0_1_1452764539431_5361" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>><br clear="none">> > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>>><br clear="none">> > > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>><br clear="none">> > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org" id="yui_3_16_0_1_1452764539431_9382">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>>>><br clear="none">> > > > <a rel="nofollow" shape="rect" target="_blank" href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a><br clear="none">> > > ><br clear="none">> > > _______________________________________________<br clear="none">> > > Gate-users mailing list<br clear="none">> > > <a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><div class="yiv3203938371yqt3640601787" id="yiv3203938371yqtfd34698"><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>><br clear="none">> > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org" id="yui_3_16_0_1_1452764539431_9320">Gate-users@lists.opengatecollaboration.org</a>>><br clear="none">><br clear="none">> > > <mailto:<a rel="nofollow" shape="rect" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org" id="yui_3_16_0_1_1452764539431_9321">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" id="yiv3203938371yui_3_16_0_1_1452764539431_4940" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>><br clear="none">> > <mailto:<a rel="nofollow" shape="rect" id="yiv3203938371yui_3_16_0_1_1452764539431_4941" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a><br clear="none">> <mailto:<a rel="nofollow" shape="rect" id="yiv3203938371yui_3_16_0_1_1452764539431_4942" ymailto="mailto:Gate-users@lists.opengatecollaboration.org" target="_blank" href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.opengatecollaboration.org</a>>>><br clear="none">> ><br clear="none">> > > <a rel="nofollow" shape="rect" id="yiv3203938371yui_3_16_0_1_1452764539431_4943" target="_blank" href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users">http://lists.opengatecollaboration.org/mailman/listinfo/gate-users</a><br clear="none">> > ><br clear="none">> ><br clear="none">> ><br clear="none">><br clear="none">><br clear="none"></div><br clear="none"><br clear="none"></div></div> </div> </div> </div></div></body></html>