Page 1 of 1

Possible solution for: oc> Cannot allocate memory

Posted: Tue Aug 16, 2005 6:56 am
by Raj
If running NEURON on MSWin you run into the message "Cannot allocate memory" while you still have a large amount of memory available, it is probably caused by the maximum program size of applications run under cygwin. Cygwin's maximum program size can be adjusted with cygwin's regtool:

http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html

Posted: Tue Aug 16, 2005 11:25 am
by ted
Thanks. I haven't seen that error msg yet, but if it occurs I now know
what to do.

Re: Possible solution for: oc> Cannot allocate memory

Posted: Mon Apr 12, 2010 1:55 pm
by eschombu
I just came across this error while running simulations on a unix system. I'm saving lots of data to files for several different runs, but encompassed within a single script. It gets through a few cases, writing almost a GB of output files to a separate folder for each, but then starts giving me the "oc> Cannot allocate memory" message. I'm pretty sure all file streams are getting closed and I'm reinitializing the same variable names, but are there ways to check these sorts of memory issues at the command line or within hoc code? I can work around these problems and be more efficient with which data I save, but I'm curious in a general sense. Once I start more parameter tuning, this may become an issue.

Thanks!

Re: Possible solution for: oc> Cannot allocate memory

Posted: Wed Apr 14, 2010 10:31 am
by hines
I would watch the memory usage with 'top' in a another terminal window while the simulation was running.
It may be the case that Vector's are being held in one of your lists and not being freed. You can know the
existence of Vectors with
objref zzz
zzz = new List("Vector")
and occasionally see the total they are using with
xxx = 0
for i =0, zzz.count-1 { xxx = zzz.o(i).size() ]
print xxx

If that is increasing then find out who references a Vector you think should be deleted via
StringFunctions[0].references(Vector[...])