fortran程序运行中出现的一个小问题!!!
warning LNK4084: total image size 1972436992 exceeds max (268435456); image may not run这个在fortran里面出现,原因是什么?清高手给予指点,还有就是该怎样解决?
回复 #1 fanghuikeer 的帖子
google一下就可以找到类似的问题,搜索的关键词为: “warning LNK4084: total image sizeexceeds max ; image may not run”(数字去掉,因为数字是跟你的程序有关的)学成知识中心 (摘自:水木BBS)
发信人: nobusiness (无所事事), 信区: NumComp
标题: 在COMPAQ主页上找到的Large Image说明
发信站: BBS 水木清华站 (Fri Apr6 17:57:18 2001)
Q1019 - Linker warning: "LNK4084 - total image size exceeds max (256MB); im
age may not run"
Platforms: All
Versions: All
Fixed in version: N/A
Article created: 08 June 1998
Article revised: 03 December 1998
Description: When linking an application which contains large arrays, the li
nker gives the warning "LNK4084 - total image size exceeds max (256MB); imag
e may not run".
Explanation: Windows 95 and Windows NT 4.0 have a limit for the total size o
f static code and data of 256MB.If the amount of static code and data exce
eds this size, the image may not execute.This is a limitation in the opera
ting system and not in Visual Fortran or its tools.The most common cause o
f large static data is large local or COMMON arrays.
Solution: For Windows NT 4.0, install Microsoft's Windows NT Service Pack 3
(or later).This raises the limit on static code and data to 1.75GB.Howev
er, the linker is not modified by this update and will continue to issue the
warning, which can be ignored.The limit on Windows 98 is 1.75GB, the same
as Windows NT 4.0 with Service Pack 3.
For Windows 95, Microsoft has not released an update which raises the limit.
For either operating system, an alternative is to make the large arrays ALLO
CATABLE. Dynamically allocated data is not subject to the 256MB limit.
Example #1: Local array
Old:
REAL BIG_ARRAY(1000,1000,500) !500MB
New:
REAL,ALLOCATABLE :: BIG_ARRAY(:,:,:)
...
ALLOCATE (BIG_ARRAY(1000,1000,500))
! ALLOCATE statement goes in executable
! part of program
Example #2: Common array
Old:
! Include file declaring COMMON array
REAL BIG_ARRAY(1000,1000,500) !500MB
New:
! New source file containing MODULE as follows
MODULE BIG_STUFF
REAL,ALLOCATABLE::BIG_ARRAY(:,:,:)
END MODULE BIG_STUFF
! Add to routines using BIG_ARRAY
USE BIG_STUFF
! Add to main program
USE BIG_STUFF
...
ALLOCATE (BIG_ARRAY(1000,1000,500)
Note that USE statements must immediately follow PROGRAM, SUBROUTINE or FUNC
TION statements.For more information on MODULE, USE and ALLOCATABLE arrays
, see the Language Reference Manual.
--
※ 来源:·BBS 水木清华站 smth.org·
上一篇 返回上一页 回到目录 回到页首 下一篇
学成知识中心 (摘自:水木BBS) 简单来说就是定义的数组过大,超过了256M的限制
页:
[1]