Terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Abandon (core dumped)

Hello GEANT4 community, I have a problem when I want to run the Advanced / ICRP110_HumanPhantoms example.

I have varied the default sex to “male” and partial phantom to “Trunk” to meet my requirements. Everything works fine until the command << ./ ICRP110phantoms >> the following error is displayed after a waiting time of about 2 minutes:

terminate called after throwing an instance of ‘std::bad_alloc’ what(): std::bad_alloc Abandon (core dumped)

I think that has a relation with the insufficiency of the memory !!!

I am using a core i5 pc with 4GB RAM.

Any ideas. Thank you

Hi Youssef

I tried your combination and after about 2 mins (on my MacBook Pro) the picture came up in my Qt viewer, with a frame rate of about 1 in 5 seconds, but it had consumed over 7 GB of memory. It is the visualisation that consumes memory, particularly Qt.

If you have built with GEANT4_USE_OPENGL_X11=ON, you can try replacing /vis/open OGL with /vis/open OGLSX in vis.mac. That only uses 4.2 GB, but you lose interactivity. With OGLIX ('I" for 'Immediate), it draws directly to the screen, and only uses 500 MB, but it takes about 15 sec to refresh the view, for example after changing viewpoint. If you have built with GEANT4_USE_XM=ON, you can get some interactivity back, with a frame rate of about 1 in 2s.

So I’m guessing it’s a memory issue with the Qt viewer. We have a fix for this and a fix for the frame rate for the upcoming 11.0 release.

John

If you don’t have X11 or Xm, just changing OGL to OGLI brings the memory usage down from 7 GB to only 600 MB, but the refresh rate is right down at about 1 in 20s, and there’s a lot of waiting to do.

Thank you, Allison, I am very grateful for your reply, thank you so much, I will try to do all that