Project

General

Profile

Support #1254

St9bad_alloc errors plotting in Python

Added by Carlisle, Timothy about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bin(aries)
Target version:
Start date:
16 April 2013
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

I'm getting the dreaded: "terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
" (memory related) errors when trying to trying to loop over my virtual planes & make plots, (the same approach given in Xboa Example 2) e.g.:

Bunch.root_graph(bunch_list, 'mean', ['z'], 'mean', ['x'], 'm', 'mm')
Bunch.root_graph(bunch_list, 'mean', ['z'], 'mean', ['pz'], 'm', 'mm')
Bunch.root_graph(bunch_list, 'mean', ['z'], 'mean', ['energy'], 'm', 'mm')
Bunch.root_graph(bunch_list, 'mean', ['z'], 'mean', ['time'], 'm', 'mm')
Bunch.root_graph(bunch_list, 'mean', ['z'], 'beta', ['x','y'], 'm', 'mm')
Bunch.root_graph(bunch_list, 'mean', ['z'], 'emittance', ['x','y'], 'm', 'mm')

etc

I get the same error if I simply fill arrays, e.g.:

for Plane in range( 0, len(bunch_list)-1 ):
my_bunch = bunch_list[Plane]
_x= round(my_bunch.get('mean', ['x'] ), 2)
_y= round(my_bunch.get('mean', ['y'] ), 2)
etc

my simulations have 10,000 muons, and >100 planes which probably isn't helping the memory side of things...I'm not well versed in Python at all, any advice on how to get round this?

Thanks,

Tim


Files

Xboa_Example2_TimEdit.txt (2.52 KB) Xboa_Example2_TimEdit.txt Carlisle, Timothy, 16 April 2013 13:13
log.out (9.91 KB) log.out Carlisle, Timothy, 16 April 2013 16:08
log2.out (2.7 KB) log2.out Carlisle, Timothy, 16 April 2013 16:11

Also available in: Atom PDF