liudu
New Member
Posts: 3
|
Post by liudu on Aug 8, 2007 7:28:47 GMT -5
When I use Compaq Visual Fortran Optimizing Compiler Version 6.5 to compile my code, I found some limitation of memory allocation. For example, the following code:
program memtest implicit none double precision mem(1000,40000) print*,'allocate memery seccussfully' stop end
the output of compiling is:
Compaq Visual Fortran Optimizing Compiler Version 6.5 Copyright 2000 Compaq Computer Corp. All rights reserved.
mem.f Microsoft (R) Incremental Linker Version 6.00.8447 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/subsystem:console /entry:mainCRTStartup /ignore:505 /debugtype:cv /debug:minimal /pdb:none C:\DOCUME~1\szhang\LOCALS~1\Temp\obj3EA.tmp dfor.lib libc.lib dfconsol.lib dfport.lib kernel32.lib /out:mem.exe mem.exe : warning LNK4084: total image size 320274432 exceeds max (268435456); image may not run
I remember in old days (before 2000) when I use Turbo C, there exists one option such that I can compile code using SMALL, LARGE mode for memory allocation.
Recently I need provide code in Windows version to Samsung. Hope I can get help of how to setup Compaq Visual Fortran, or Intel Visual Fortran such that It will accept large memory allocation.
Thanks
|
|
|
Post by xueyong on Aug 9, 2007 19:20:16 GMT -5
This is just a warning from MS linker. You can suppress it with linker option, but I don't see the benefit of doing it. In the not too old days of Win 95, static code and data can't exceed 256MB. Otherwise it won't load. On newer 32-bit system (2000/XP), the limit is 2GB or 3GB with tweaking. Your code should run if you stay within this memory limit. If the array isn't needed all the time, it is better to do dynamic memory allocation. (malloc/free, ALLOCATABLE/DEALLOCATE). Hope this helps. Xueyong
|
|