Thanks for your report.

Actually, it does not seem to have much to do with continued
fractions but rather with the symbolic ring

sage[4]: for i in [2500000,..,3000000]:
.......:     if i%1000 == 0:
.......:         print(i);
.......:         print(get_memory_usage())
.......:     _ = RIF(sqrt(i))

Le 23/07/2020 à 18:30, Spencer Dembner a écrit :
When using continued_fraction to compute denominators of continued fraction
convergents, I'm encountering what seems to be a memory leak. I'm running
SageMath 9.0 on Windows 10 64-bit. If I run the following,

for i in [2500000,..,2600000]:
     if i%1000 == 0:
         print(i);
         print(get_memory_usage());
     C = continued_fraction(sqrt(i));
     C.denominator(100);

then I see memory usage steadily climbing as I iterate through the loop. On
the other hand, if I initialize sqrt(i) as an algebraic number, memory
usage is essentially stable:

for i in [2500000,..,2600000]:
     if i%1000 == 0:
         print(i);
         print(get_memory_usage());
     if sqrt(i) not in QQ:
         K.<sqrti> = QuadraticField(i);
         C = continued_fraction(sqrti);
         C.denominator(100);


--
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/e78346c1-db3b-e28b-f522-ebe760f9b4b4%40gmail.com.

Reply via email to