CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Cannot allocate memory for arrays (1400,1000) (

Quarkz January 21, 2008 10:13

Cannot allocate memory for arrays (1400,1000)

I hope someone who uses compaq visual fortran can give me some help, although this may not be the proper forum. I'm trying to do dynamic allocation for several arrays (1400,1000) in size. When I try to allocate memory for these arrays, the 1st 2 have no problem. However after that it complains cannot allocate memory.

Have I ran out of ram or memory? I've 2gb of ram and I'm using double precision. I thot each real value takes up 8bytes, so 1400x1000 values only uses around 11 Mb. How could my mmemory be insufficient?

Is there anyway around this, like using the hdd as memory? It's ok if it's slow though.


Ertan Karaismail CFD&AMP January 21, 2008 12:14

Re: Cannot allocate memory for arrays (1400,1000)
Try increasing stack size in fortran.



Quarkz January 21, 2008 21:15

Re: Cannot allocate memory for arrays (1400,1000)
Well, I've already increased the stack size to the max of ~4290000000 but it still can't work... :(

Ertan Karaismail CFD&AMP January 22, 2008 02:46

Re: Cannot allocate memory for arrays (1400,1000)
If you send the code, or post it here, I can try running on my computer. Normally, I can allocate those arrays without a problem. Maybe it's with your code, I don't know. Are you opening too many files and reading from them? If you don't close them that can take much of your memory.


Quarkz January 23, 2008 22:59

Re: Cannot allocate memory for arrays (1400,1000)
Thanks Ertan. I can send u the .exe file to test. of cos, u may be worried that it might be a trojan or virus. anyway, i've send the job over to a linux server and it really seems that the memory requirement is more than 2gb. in fact, it's around 3gb. i guess tt's why.

thanks anyway.

Steve January 27, 2008 07:38

Re: Cannot allocate memory for arrays (1400,1000)
Are your arrays local (stack) variables? If so, try allocating them on the heap instead (COMMON).

All times are GMT -4. The time now is 17:56.