Probably this shares the same bug as [1] Calling `NumberField().class_group().order()` in a loop of size N: #10^3 leaks: 40.03 MB 40026112 pari= [7950, 1451665] #10^4 leaks: 338.49 MB 338493440 pari= [83505, 19297360]
The leak appears to be in the pari heap. Code .sage: ==== #Author Georgi Guninski Wed Sep 4 12:58:18 PM UTC 2024 #10^3 leaks: 40.03 MB 40026112 pari= [7950, 1451665] #10^4 leaks: 338.49 MB 338493440 pari= [83505, 19297360] import psutil,gc,sys from sage.all import EllipticCurve ps = psutil.Process() num=10**3 #10**5 // 2 x=var('x') def leaknf5(N=10**3): gc.collect() base = ps.memory_info().rss for A2 in range(1, N): Kn=NumberField(x^2+A2,'w') m=Kn.class_group().order() gc.collect() mem = ps.memory_info().rss - base print(f"{mem/1e6 :.2f} MB ",mem," pari=",pari.getheap()) leaknf5(10**4) ==== [1]: https://groups.google.com/g/sage-devel/c/fWBls6YbXmw Memory leak in |EllipticCurve([n,0]).root_number()| and problem in algebraic geometry -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGUWgD9Ysud5yEocdL0VJHqCSXd4bUGFk%2Bidx7KFOxB59Qto%3Dw%40mail.gmail.com.