GMP memory leakage global variable

Vincent Lefevre vincent at
Mon Jul 5 07:57:24 UTC 2021

On 2021-07-05 08:52:09 +0200, Paul Zimmermann wrote:
> I guess memory is leaking since you initialize variable n *within*
> the loop and don't clear it (mpz_clear).

It is cleared: see the mpz_clear at the beginning of the loop.

But there might be memory fragmentation. Otherwise, I don't know.
There isn't enough information.

Vincent Lefèvre <vincent at> - Web: <>
100% accessible validated (X)HTML - Blog: <>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-discuss mailing list