allocation of 10790760 bytes too large
Here is the error message first, followed by my description of what happened.
hs> ghc -o void void.hs -rtsopts [1 of 1] Compiling Main ( void.hs, void.o ) Linking void.exe ... hs> void +RTS -K400M -RTS > void.txt void: internal error: allocation of 10790760 bytes too large (GHC should have complained at compile-time) (GHC version 7.8.3 for x86_64_unknown_mingw32) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug hs> void +RTS -K40000M -RTS > void.txt void: internal error: allocation of 10790760 bytes too large (GHC should have complained at compile-time) (GHC version 7.8.3 for x86_64_unknown_mingw32) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Description of what happened: I gave my program really large numbers. It contains the following line:
rr = (of40)*(r^3041)
of40 is an integer which has about
2 515 968
(that is two million+) decimal digits (explicitly
written out and initialized in the .hs file).
of40 is multiplied by
r is a 250-digit number so
760 250 (seven hundred sixty thousand+) decimal digits.
This makes the product
rr = (of40)*(r^3041)
have more than
3 000 000 (three million+) decimal digits.
I tried to compile it three times, twice unsuccessful (insufficient amount of memory during compilation), and the third time successful, after 12 hours work by the compiler, and me increasing the paging file to initial size 49152 Mb, max size 196608 Mb. (At the end of compilation the Paging file reported as: Recommended 24574 Mb, Currently allocated: 163765 Mb.) I run a Hewlett-Packard HPE 500y, upgraded to 16 Gb RAM, Windows 7, AMD Phenom(tm) II X6 1045T Processor 2.70 GHz (6 core). The compiler produced a big exe file: 09/27/2014 09:38 PM 20,602,960 void.exe When I tried to run the exe file I got the error messages as already enclosed at the beginning of this description. Most of the time during compilation the computer used all of the available memory.
Note that I gave the options -rtsopts to the compiler, and the option +RTS -K400M -RTS when I tried to execute the compiled program (I believe this is some kind of a request for more memory), and one more attempt with +RTS -K40000M -RTS, both versions generated the error messages shown above.
P.S. Thanks to Richard Eisenberg and Herbert Valerio Riedel for replying to my email, after BotScout kept me from submitting my report. Apparently I passed the evaluation-captcha (on my second attempt) but nevertheless BotScout insisted I was spam.