#16803: Reimplement matrix_integer_dense using FLINT
-------------------------------------+-------------------------------------
       Reporter:  mmasdeu            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  linear algebra     |   Resolution:
       Keywords:  flint, matrix      |    Merged in:
        Authors:  Marc Masdeu        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/mmasdeu/16803-matrix_integer_dense_flint|  
0d37b701fbd845ee36fdaa6dcf62bae71bf4d6af
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by was):

 I don't think the changeset with name "Fixed memory leak" fixes the memory
 leak, at least not for matrix multiplication.  I'm not sure if you're done
 yet.  With your fix, if you run the functions `test1`, `test2` or `test3`
 in the script `2014-08-29-180550-stupid-test.sage` below, then the memory
 usage (print out second) grows quite rapidly and doesn't go down.  Doing
 the same thing in sage-6.3 results in almost no leakage of the heap.    In
 particular, with your patch after running those 3 tests I ended up with
 over 2GB extra memory used (oer startup), even after doing `import gc;
 gc.collect()`.  Doing the identical thing with sage-6.3 uses only a few
 MB's.

 {{{
 def t0(n):
     a = random_matrix(ZZ,n)
     b = random_matrix(ZZ,n)
     assert a*b == a*b

 def t(n):
     a = random_matrix(ZZ,n)
     b = random_matrix(ZZ,n)
     assert a*b == a._multiply_multi_modular(b)

 def test1():
     for n in range(1,50):
         print n, get_memory_usage()
         set_random_seed(0)
         for i in range(100):
             t(n)

 def test2():
     for n in range(51,150):
         print n, get_memory_usage()
         set_random_seed(0)
         for i in range(10):
             t(n)


 def t2(n):
     a = random_matrix(ZZ,n,2*n)
     b = random_matrix(ZZ,2*n,n)
     at = a.transpose()
     bt = b.transpose()
     assert a*b == a._multiply_multi_modular(b)
     assert bt*at == bt._multiply_multi_modular(at)

 def test3():
     for n in range(1,50):
         print n, get_memory_usage()
         set_random_seed(0)
         for i in range(50):
             t2(n)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16803#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to