Re: memory leak huge number of digits mpz_mul,mpf_sqrt_ui

2021-02-26 Thread Torbjörn Granlund
Are you famiiar with valgrind? It is a great tool for detecting memory leaks. I used it to oonfirm that GMP indeed does not leak for your test cases. (You seem to have forgotten to mention the system you used for these experiments; I used an amd64 cpu running debian.) Your analysis of what is

Re: memory leak huge number of digits mpz_mul,mpf_sqrt_ui

2021-02-26 Thread Paul Zimmermann
Dear Susumu tsukamoto, I tried valgrind with the following simplified program and it shows no memory leak: $ cat test_mul.c #include "gmp.h" int main() { long int num = 20; // 200,000,000 long int ik; mpz_t DC; printf(" start: num= %'ld \n", num);

memory leak huge number of digits mpz_mul,mpf_sqrt_ui

2021-02-25 Thread cents2823
y in so end \n");     scanf("%s", dm); } Susumu tsukamoto - Original Message - From: Torbjörn Granlund To: cents2...@yahoo.co.jp Cc: "gmp-bugs@gmplib.org" Date: 2021/2/25, Thu 20:22 Subject: Re: memory leak huge number of digits mpz_mul, mpf_sqrt_ui Your analys

Re: memory leak huge number of digits mpz_mul, mpf_sqrt_ui

2021-02-25 Thread Torbjörn Granlund
Your analysis is very likely incorrect. You may cause the same "leak" without GMP. Just malloc a set of large chunks of different sizes. Access them to make sure it is actually there, then free them in some random order. Often the free calls will not have given back the memory to the system.

memory leak huge number of digits mpz_mul, mpf_sqrt_ui

2021-02-25 Thread cents2823
Dear GMP developers, I am making a program that calculate pi using GMP. There is a memory leak that seems to be the cause of GMP. It seems that a memory leak occurs when a huge number of digits  multiplying and square root calculation. The following test program(test_mul.c, test_sqrt.c) causes a