- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When running a program I encountered the run-time error message 41: No sufficient virtual memory.
I am running for visual fortran v.11.1.054, winXP64 SP1. The machine is HP xw8400, Xeon5160 quad processors, 8GB RAM.
I have changed thethe virtual memory setting in the "properties - advanced" optionsfrom default max of 4GB to 128GB for allowed paging but the same problem happened at the same time (after running 3 1/2 hrs).
Any hints on how to solve this problem will be greatly appreciated.
I am running for visual fortran v.11.1.054, winXP64 SP1. The machine is HP xw8400, Xeon5160 quad processors, 8GB RAM.
I have changed thethe virtual memory setting in the "properties - advanced" optionsfrom default max of 4GB to 128GB for allowed paging but the same problem happened at the same time (after running 3 1/2 hrs).
Any hints on how to solve this problem will be greatly appreciated.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like you have a memory leak? You might start by monitoring your program's memory use using Task Manager, and watch how it grows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your suggestion and I'll start to monitor the memory. If there is a memory spike, will increase the maximum allowable pagingin "my computer - properties - advanced -virtual memory" solve the problem? (Is that the right place for virtual memory control?) Is there any inherent limit for the compiler? Or are theresome other buttons I can push to solve this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your application genuinely needs a lot of memory, increasing the "virtual memory" setting may help. There's usually also an option to let the system manage the size of the pagingfile, so that it is increased automatically when necessary. But if you are making significant use of all this virtual memory, your application may become very slow, as it spends a lot of time paging in and out.
On the other hand, if you have a memory leak, (running for >3 hours before running out of memory is suggestive of this), memory use may just go on and on gradually increasing, and no amount of additional virtual memory may be enough. Programs without leaks usually allocate most of the needed memory near the start, and subsequent changes may cause the memory usage to go down as well as up.
On a 64 bit system, there is essentially no limit coming from the compiler itself, provided that you allocate memory dynamically (E.g. using ALLOCATE statements, and not static declarations).
You should check that memory that is ALLOCATEd subsequently gets DEALLOCATEd, either explicitly or implicitly. Also, try to use allocatable arrays in preference to pointers, if you don't need the pointer functionality. The compiler and library won't let you allocate an allocatable array multiple times, whereas I suspect it would allow you to keep allocating new memory to a pointer.
On the other hand, if you have a memory leak, (running for >3 hours before running out of memory is suggestive of this), memory use may just go on and on gradually increasing, and no amount of additional virtual memory may be enough. Programs without leaks usually allocate most of the needed memory near the start, and subsequent changes may cause the memory usage to go down as well as up.
On a 64 bit system, there is essentially no limit coming from the compiler itself, provided that you allocate memory dynamically (E.g. using ALLOCATE statements, and not static declarations).
You should check that memory that is ALLOCATEd subsequently gets DEALLOCATEd, either explicitly or implicitly. Also, try to use allocatable arrays in preference to pointers, if you don't need the pointer functionality. The compiler and library won't let you allocate an allocatable array multiple times, whereas I suspect it would allow you to keep allocating new memory to a pointer.
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
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