memory leak huge number of digits mpz_mul,mpf_sqrt_ui

2021-02-25 Thread cents2823
Thank you for your response. Your answer is difficult and I don't understand well. I am making a program to calculate pi, and when I calculate a huge number of digits pi, the calculation is finished and all the variables are released, but a lot of memory remains in use. I set a release flag for

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