Hi, This question arises from the patch here http://www.sagetrac.org/sage_trac/ticket/1413 but my question is rather tangential. The patch is for _sig_on/_sig_off added to the mpoly libsingular code.
Micheal pointed out that a Ctrl+c signal to singular could produce some corruption because of an ungraceful termination of singular C++ code. Now, I guess this is obviously true and it occurs to me that it really has nothing to do with singular. So, I tried the following: sage: R.<x>=ZZ[] sage: f=R([ZZ.random_element(15)*x^i for i in range(10000)]) .... wait a long time and press Ctrl+c Sure enough, the memory usage in top slowly climbs and doesn't (always) drop back after the Ctrl+c. I garbage collect: sage: import gc sage: gc.collect() and the memory usage still doesn't go down. So, I guess the memory is leaked. It could be that I'm reading top wrong ... memory columns never seem to make sense to me. Some questions: Did everyone already know this? Does anyone care that Ctrl+c can leak memory from c/c++ libs? Is the problem somehow worse for singular (it's semantics for when functions delete/modify their parameter seem just a bit nebulous to me)? -- Joel PS. To answer Micheal's question on the trac ticket, I wanted it because singular can take multiple seconds to compute gcds. Obviously, you'd also want it for huge (I don't know how huge) multiplies although that patch doesn't actually add the signal handling to _mul_. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
