Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Difference static and dynamic allocation on max array size

timtjanssen
Beginner
647 Views
I work on a PIII with 1GB memory + 1Gb SWAP. I am puzzled about my memory usage.

My ulimit -a reads

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited


My maximum array is (according to the compiler)about 2.1 GB, which makes sense given the physical limitations of my
memory. However when I compile

real(kind=4),allocatable,dimension(:,:):: t1
allocate(t1(5000,38233))

then the (5000,38233) is about the maximum size I can get (corresponding to around 765Mb), the machine cries at run-
time that it has not enough virtual memory if make this array any larger. If I do the same but written as

real(kind=4),dimension(5000,107000):: t1

then this is the maximum size I can get without problems. Here I do get the physical limit (~2.1 Gb).

How can I use dynamic allocatation and still use all my physical resources? Why the difference?

Thanks!
0 Kudos
0 Replies
Reply