Out of memory at compile time

78 views
Skip to first unread message

Walter

unread,
Dec 5, 2014, 5:27:33 PM12/5/14
to gg...@googlegroups.com
I'm trying to compile  a .F90 dll where I need to load a large amount of data at compile time (through several data statement).

At compile time I get the following output error:

Fatal Error: Out of memory-- malloc() failed

Monitoring the memory usage, I actually verified that my laptop is running out of it.

Is there any way to by pass this issue?

Thanks for the support.

Best regards,

Walter

jfh

unread,
Dec 14, 2014, 6:18:24 PM12/14/14
to gg...@googlegroups.com

The obvious thing is to rewrite your program to read the data from a file at run time instead of using DATA statements. If that still fails, think carefully about whether all the data are needed at once. If not, then you can read some of the data into a smaller array (or whatever you were using), process that, and then read some more data into the same array, process that, etc. .    

Best regards,

Walter

Walter

unread,
Jan 16, 2015, 6:54:46 PM1/16/15
to gg...@googlegroups.com
Thanks for your support: that's exacly what I did in the meantime.

The funny thing is that now the program works when compiled as an independent .exe but, when I try to compile it as a .dll is doesn't work anymore (there is a subroutine I need to call from a desktop application).

After some debugging, I found out that the issue happens when I read the external files (binary format):
- in .exe version, everything goes fine;
- in .dll version, I'm able to read up to few thousand data, but not the complete database.

Actually the code is the same. May it be a compiler bug?

Walter

Loup Blanc

unread,
Mar 16, 2015, 9:31:36 AM3/16/15
to gg...@googlegroups.com
Hi Walter,

Did you try to increase the virtual memory ?

Example for windows system : http://www.ultraedit.com/support/tutorials_power_tips/ultracompare/increase-virtual-memory.html

On a linux system i change command ulimit....

Regards

Walter

unread,
Apr 7, 2015, 5:32:32 PM4/7/15
to gg...@googlegroups.com
Yes, but without success. I found a workaround by incapsulating all my data in a single array variable and reading the complete array in one time.
Even if the amount of red data is the same, reading everything with a single read statement solved the issue.

It seems to be a compiler bug.

Walter
Reply all
Reply to author
Forward
0 new messages