I have written a fortran code that involves several calculations with 2D arrays. The program works fine below certain threshold... namely, 360x360. Above this, the program crash and a segmentation fault message appears. As I am working on a Mac OX 10.8.4 I can't increase the stack size... So, I have compiled with the -heap-arrays option, and the program runs without "problems" except for it takes around 2GB of the RAM memory, causing a poor performance on the machine. Below the thershold the program just takes 20MB in the RAM. All the arrays have been defined dinamically.
I've used the gdb debugger and I know exactly from where (which subroutine) the segmentation is coming, but, the code seems to be ok there.
Somebody can figure out how I could handling this issue?
Thanks in advanced,