Memory usage for large multiplications

Vincent Lefevre vincent at vinc17.net
Fri Jan 29 17:18:10 CET 2010


On 2010-01-29 14:48:06 +0100, Paul Zimmermann wrote:
> > GMP-5.0 uses an itch/scratch logic, it allocates (almost) all needed
> > memory before starting the computation, and frees it all at the end.
> > GMP-4.3 allocates, then frees, then allocates again, and frees again... It
> > is much more difficult to get the "maximal" snapshot.
> 
> maybe this latter strategy is better, since at any time you have allocated
> just what is really needed (assume for example you have several GMP threads
> on the same computer).

FYI, Linux has the ability to overallocate memory, allocating it
really only when needed. In such a case, the former strategy is
better. But I wouldn't recommend it, as in case of lack of memory,
expect random processes to be killed by the OOM Killer. :(

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list