Thanks so much to both of you for your comments! They greatly helped me. > But first you should review your own code for the places it does a large number of allocations and deletions of objects. I do have dynamic memory allocations, but not that many. I use expression templates, which eliminate most temporaries. I even solve the system without using matrices. The last time I profiled my testcases, virtually all of the runtime was spent in the “matrix”-vector products of the BiCGStab algorithm. My programs mostly look like this one: https://godbolt.org/z/Kn9M75e5o. > That is surprising Thanks for confirming. As I said, I am totally illiterate in computer science and didn’t know if it was normal. > but you should talk to the Gmsh developers about it. > Maybe deleting those objects causes some other effects like destroying > memory pools, which then alters the behaviour of the rest of the program. > The Gmsh devs are in the best position to analyze it and explain it (and > maybe solve it). I will! For context, I will post a link to this thread unless you tell me otherwise. I was about to file a problem report to Gmsh, but dissecting the problem it seemed to me that they were just calling the global `new` and `delete` operators. I even greped for overloads of these operators and didn’t find anything. If there were, could these overloads be leaked into my library? > an alternate version of the routines managing the free memory pool (a few were available years ago, when I had this same problem). I don’t think that I’m skilled enough to use non-standard facilities for managing memory.