- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am porting a sizeable mixed-language (mostly Fortran) code from UNIX to PC. I used Visual Fortran Console Application to create my Windows executable (size = 776 KB) which linked and compiled fine. Upon execution, the DOS Command Prompt gives "program too big to fit in memory." When certain arrays in the code are decreased in size (thus making the program useless for us), the Command Prompt runs the program successfully with no memory errors.
The problem seems to be in accessing DOS Extended Memory or something of this nature. Is there any easy way to get around this memory problem? Thanks for any input.
Justin
The problem seems to be in accessing DOS Extended Memory or something of this nature. Is there any easy way to get around this memory problem? Thanks for any input.
Justin
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess is that you're on Windows 95. If so, please upgrade the OS to at least Windows 98. Windows 95 has a 256MB limit on the total static (code and data) size of an executable - you would have received a warning about this at link time. Windows 98, NT4-SP3 and later Windows versions don't have this limit, though you'll still get the linker warning.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am actually on Windows NT. It was compiled with NT as the OS also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How big are your arrays? Do you get a warning during linking? What does it say?
By the way, there is no DOS nor "DOS extended memory" under Windows NT.
Steve
By the way, there is no DOS nor "DOS extended memory" under Windows NT.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The biggest arrays are 1024x1024 and there are 2 or 3 of them. The item that is passed between the C code and Fortran code is of type char(1280000) (in C) and BYTE(1280000) (in Fortran.) Also, I get no errors when linking but I did in the past and had to ignore the "libcd.lib" library for it to compile properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That all looks ok so far. Now - you say "DOS command prompt" How do you get to this prompt? Does the program run if you just double-click on it from a Windows explorer window?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Start menu --> Programs --> Command Prompt
and then a small window opens with a DOS-like C prompt.
If we just double click the executable, it opens the Command Prompt window (same as Start Menu option mentioned above) and closes it very quickly and does not produce the anticipated output files. Besides, the program usually takes a few seconds/minutes to run. Keep firing away with questions...
-Justin
and then a small window opens with a DOS-like C prompt.
If we just double click the executable, it opens the Command Prompt window (same as Start Menu option mentioned above) and closes it very quickly and does not produce the anticipated output files. Besides, the program usually takes a few seconds/minutes to run. Keep firing away with questions...
-Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is all very puzzling - in particular, I can't see how you would get a 'program too big to fit in memory' error unless you were actually running DOS, which you aren't.
Can you send me the EXE? Steve.Lionel@intel.com
Steve
Can you send me the EXE? Steve.Lionel@intel.com
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I Assume you have checked your available total RAM??
with several arrays of size 1024 * 1024 = 1M elements = 8MB each for
Doubles your program probably requres over 64 MB AVAILABLE RAM
or atleast 128 MB real memory. This is'nt much today, but 128 is the MAX
my P-II 266 will hold...
with several arrays of size 1024 * 1024 = 1M elements = 8MB each for
Doubles your program probably requres over 64 MB AVAILABLE RAM
or atleast 128 MB real memory. This is'nt much today, but 128 is the MAX
my P-II 266 will hold...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Justin sent me his EXE - it was entirely filled with NULs! Windows didn't like that and it gives the rather cryptic error when that happens. He then sent me the sources and I was able to build it on my system.
How he ended up with a huge EXE of all NULs is beyond me...
Steve
How he ended up with a huge EXE of all NULs is beyond me...
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The situation has beenr esolved. Thanks to all who offered help. Here's the conclusion: there were actually two different problems.
- problem 1, stack size was too small
-solution, increased the stack size on the Link command line using /stack:size
- problem 2, EXE file was too big
-solution, changed from debug mode to release mode and the executable shrunk considerably. perhaps I switched a setting somewhere or perhaps not. regardless, it all works now. Thanks again!
-Justin
- problem 1, stack size was too small
-solution, increased the stack size on the Link command line using /stack:size
- problem 2, EXE file was too big
-solution, changed from debug mode to release mode and the executable shrunk considerably. perhaps I switched a setting somewhere or perhaps not. regardless, it all works now. Thanks again!
-Justin

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page