Bad_alloc error

Anything that doesn't fit elsewhere.
Post Reply
shyam_u2
Posts: 77
Joined: Sun Feb 20, 2011 7:15 pm

Bad_alloc error

Post by shyam_u2 »

When I run my large scale network model, I get this following error, When the model finishes running for 800 ms,

terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
[tombo11408:12824] *** Process received signal ***
[tombo11408:12824] Signal: Aborted (6)
[tombo11408:12824] Signal code: (-6)
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_allocterminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc

May I know what causes this ?
regger
Posts: 21
Joined: Sun Apr 22, 2012 9:49 pm

Re: Bad_alloc error

Post by regger »

That's actually a pretty generic error message raised typically when a program fails to dynamically allocate memory during runtime.
You say it's a large scale model - do you record a lot of variables from all neurons?
If yes, does it run ok for a shorter amount of time?
Have you tried running it on a machine with more RAM?
shyam_u2
Posts: 77
Joined: Sun Feb 20, 2011 7:15 pm

Re: Bad_alloc error

Post by shyam_u2 »

Yes I do record data from a lot of neurons.
If I run it for a shorter time, I don't get any errors.
How do I get rid of this error ?
regger
Posts: 21
Joined: Sun Apr 22, 2012 9:49 pm

Re: Bad_alloc error

Post by regger »

My guess would be you don't have enough RAM to record all the data for such a long time.
Simplest solution would be to try running it on a machine with more RAM.
If that's not an option, you should look into pausing the simulation at certain intervals, writing all the information to disk, clearing all vectors, and resume the simulation. See Ted's HowTo for this: http://www.neuron.yale.edu/neuron/node/70 and specifically http://www.neuron.yale.edu/neuron/node/76
Post Reply