Changes between Initial Version and Version 2 of Ticket #21825


Ignore:
Timestamp:
11/04/16 19:21:20 (5 years ago)
Author:
slabbe
Comment:

Importing the description from #21826. A little bit simplified version of code causing the leak.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21825

    • Property Cc mkoeppe added
  • Ticket #21825 – Description

    initial v2  
    22
    33{{{
    4 def get_polytope(M):
    5     q = MixedIntegerLinearProgram( maximization = False, solver = 'Coin' )
    6     w = q.new_variable(real = True, nonnegative = True)
    7     for v in M.rows():
    8         q.add_constraint( dot_prod(v, w) == 0 )
    9     return None
     4def get_polytope():
     5    q = MixedIntegerLinearProgram(maximization=False, solver='Coin')
     6    w = q.new_variable(real=True, nonnegative=True)
     7    q.add_constraint(w[0]==0)
     8
     9def fill_memory(n):
     10    for i in xrange(n):
     11        P = get_polytope()
     12
     13sage: get_memory_usage()
     14288.58984375
     15sage: fill_memory(2000); get_memory_usage()
     16300.5859375
     17sage: fill_memory(2000); get_memory_usage()
     18302.5859375
     19sage: fill_memory(2000); get_memory_usage()
     20303.5859375
     21sage: fill_memory(2000); get_memory_usage()
     22305.5859375
    1023}}}
    1124