insufficient virtual memory

MOHID Water forum. Questions and discussion around MOHID Water
MOHID Beginner
Posts: 1
Joined: Tue Sep 27, 2011 09:37

insufficient virtual memory

Postby » Mon Oct 03, 2011 13:41

Dear all,

I`m trying to run a project in another core i7 64x machine.
My problem is by running the same project in another PC the memory usage increase of during the run.
This means that the MohitWater64x executable file use all the memory until crash point and an insufficient virtual memory error appears.
I replaced a 32x executable file instead of 64x for checking the memory usage.
Now the model memory usage, is stable & the model is going on.
Who has the experience in this regards?

Best Regards,

Posts: 22
Joined: Thu Jan 01, 1970 00:00

Re: insufficient virtual memory

Postby » Wed Dec 07, 2011 13:12

Dear Eshan,

I have experienced the same problem than you with 64bits though I didn't tested it with 32bits.

This happens, in my case, when I use the ifort compiler option "-heap-arrays 16" which tells the code to load all temporary allocated components bigger than 16 kilobytes in the heap memory instead of loading them in the stack memory. If I don't use that option at all, I don't get any apparent memory leaks and the code runs fine.

But why do I use the "-heap-arrays 16" option in the first place?
I use it, because otherwise, in some heavier simulations that use module Life or waterquality and that have many many waterproperties, I often get a "Stack overflow" error in windows OS. This is because windows memory management impose a 2GB limit to the Stack memory (so even if I have 6 GB or more of free ram it doesn't matter). So, by using "-heap-arrays 16" as a compiler option, I ensure that all temporary allocated arrays will be stored in heap memory instead of stack memory. The heap memory is slower than the stack but it doesn't has the 2 GB limit.

So, if I don't use "-heap-arrays x" I often get "Stack overflow" error in windows when using many many waterproperties (due to the 2GB limit on the stack) and if I do use "-heap-arrays x" I will get an "insufficient virtual memory" error (apparently an x64 problem only).

How do I solve this problem?

Well, I found that if I put the "-heap-arrays x" compiler option only in the MOHIDBAse1 and MOHIDBase2 but remove it from the "MOHIDWater", then the memory usage remains stable. This is what I recommend you to use and this is the compiler configuration that I committed in the source code repository.

I believe this is an intel fortran specific problem and I did make a post in the intel fortran forum at the time, but it didn't lead nowhere productive. Maybe a newer version of intel fortran will fix this issue (I had this issue with ifort 11.1)?

I hope this experience I had will help you ...



Return to “MOHID Water”

Who is online

Users browsing this forum: No registered users and 3 guests