Subject: Huge number crash ...
Date: Wednesday 21 September 2011, 18:38:42
From: manu hobert <manu....@gmail.com>
To: themp...@gmail.com
Hello,
I'm trying to make some programs to calculate some quite huge numbers, like
phi with 1 000 000 000 decimals (witch uses about 1GB ram) ...
but when my ram usage got too high ~1GB it crashed and said: "cannot
allocate memory (size=*****)".
this happens with all of my programs, as soon as it goes too big it crashes.
i have enough ram though, i've got 4GB ram (when i run my progs i have about
2.5 - 3 GB free memory).
I haven't got any idea why this happens to me ...
some extra info:
- i'm using mpir 2.4.0
- i use the gc version
- i compiled mpir as a static lib
--
Manu
-----------------------------------------
>
> ---------- Forwarded Message ----------
>
> Subject: Huge number crash ...
> Date: Wednesday 21 September 2011, 18:38:42
> From: manu hobert <manu....@gmail.com>
> To: themp...@gmail.com
>
> Hello,
> I'm trying to make some programs to calculate some quite huge numbers,
> like
> phi with 1 000 000 000 decimals (witch uses about 1GB ram) ...
> but when my ram usage got too high ~1GB it crashed and said: "cannot
> allocate memory (size=*****)".
> this happens with all of my programs, as soon as it goes too big it
> crashes.
> i have enough ram though, i've got 4GB ram (when i run my progs i have
> about
> 2.5 - 3 GB free memory).
> I haven't got any idea why this happens to me ...
Try rebuilding mpir with the configure
option --enable-alloca=malloc-reentrant.
If reentrancy is not required, configuring instead
with --enable-alloca=malloc-notreentrant should be faster (and therefore
preferable). See http://gmplib.org/manual/Build-Options.html#Build-Options .
I'm not sure if that will solve your problem - but worth trying, imo.
Cheers,
Rob
One thing to keep in mind is the amount of temporary memory that needs
to be allocated to calculate the result. I calculated sqrt(5) to
325,000,000 decimal places and the calculation consumed over 2GB of
RAM.
>
> some extra info:
> - i'm using mpir 2.4.0
> - i use the gc version
> - i compiled mpir as a static lib
>
> --
> Manu
>
> -----------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups "mpir-devel" group.
> To post to this group, send email to mpir-...@googlegroups.com.
> To unsubscribe from this group, send email to mpir-devel+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.
>
>