- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am developing a large scientific simulation program which needs a huge amount of memory - sometimes up to 1.8 GByte. The Fortran main subroutine calls a C function which allocates the required memory using the standard malloc() function of the C runtime system. Unfortunately it is impossible to allocate more than 1.25 GByte within this program. The size of the executable is about 20 MByte and the size of the .bss and .data segments are about 8 MByte. Therefore I think it should be possible to allocate much more than these 1.25 GByte.
Pure C programs and also small Fortran programs get about 1.9 GByte, so I think that the Fortran runtime system reserves some memory in its startup code.
Does anyone come across this behaviour before or does anyone have a solution or a workaround for this problem ? Maybe there are some compiler or linker flags I do not know.
Thanks, Arne
Pure C programs and also small Fortran programs get about 1.9 GByte, so I think that the Fortran runtime system reserves some memory in its startup code.
Does anyone come across this behaviour before or does anyone have a solution or a workaround for this problem ? Maybe there are some compiler or linker flags I do not know.
Thanks, Arne
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're pushing the limit of the total addressable space under Windows. Fortran does not "reserve" memory - it does allocate some if you open files, and, of course, if you use ALLOCATE. Linker settings won't help here. I think malloc may have some internal limits - you might try VirtualAlloc instead.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OD, I spent some additional hours in debugging the application and found out the the memory is not allocated by the Fort ran run time system but by the OpenGl libraries of Windows 2000. Just one single call to an OpenGl function (e.g. hdc = wglGetCurrentDC()) is enough to load the libraries which allocate about 500 BB of memory.
Thanks, Are
Thanks, Are
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