Re: [sage-support] Out of memory error when dividing vector by scalar
Indeed, the problem seems to still be present in 5.2rc1. I've tracked the call to basis() back to an inefficient implementation of gen() in FreeModule_ambient (apparently the coercion framework ends up calling an_element() which in turn ends up calling gen()). It seems easy enough to fix. I made a ticket and a patch for this: http://trac.sagemath.org/sage_trac/ticket/13304 - Daniel -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Out of memory error when dividing vector by scalar
I'm using sage 4.6.1 (release data 2011-01-11) on Linux. When I tried to divide a vector of ~1 elements by a scalar, it ran out of system memory and crashed. code: n = 1 v = vector([0]*n) # ok so far v2 = v/1 # kaboom I repeated this process for increasing values of n starting at 100 and monitored memory usage and noticed that the memory used increases in a rapid, nonlinear fashion. It's not used when constructing the list or vector, only when the division occurs. There's nothing magic about the exact value of n, but I have ~1GB ram and with my typical system load, it crashed on me usually near n=9127. Also, i noticed that memory was not freed up after del v or del v2. I tried with other scalar rings as well (such as Zmod(p^k) for various p,k) and no difference. If someone can post a quick fix here, I would like to patch my system. Thanks! -kyle -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
Re: [sage-support] Out of memory error when dividing vector by scalar
After some digging -- and a fortuitous control-C at the right moment -- it looks like it's trying to construct the basis for the ambient free module. This will be a list of 10^4 vectors, each 10^4 elements long, so it's not surprising it takes a lot of memory.. adding a print statement in the loop in FreeModule_ambient.basis seems to confirm that's the issue. Unfortunately suggesting how to get around this requires a deeper understanding of Sage internals than I have. :-/ Doug -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org