Changes between Initial Version and Version 3 of Ticket #10548


Ignore:
Timestamp:
01/07/11 22:04:33 (10 years ago)
Author:
mderickx
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10548 – Description

    initial v3  
    1 When I was doing some computations on modular forms, I noticed the following strange memory usage behaviour which. After the first two iterations it seems like there is a memory leak. But strangely enough it stops leaking at the third iteration.
     1When I was doing some computations on modular forms, I noticed that the ModularSymbols_clear_cache() was not doing what it claims to do.
    22
    33{{{
    4 sage: import gc
     4sage: import gc 
     5sage: ModularSymbols(Gamma1(29),sign=1)
     6Modular Symbols space of dimension 49 for Gamma_1(29) of weight 2 with sign 1 and over Rational Field
     7sage: ModularSymbols_clear_cache()
    58sage: gc.collect()
    6 54
    7 sage: get_memory_usage()
    8 819.7578125
    9 sage: for i in xrange(10):
    10 ....:     ModularSymbols(Gamma1(97),sign=1)
    11 ....:     ModularSymbols_clear_cache()
    12 ....:     gc.collect()
    13 ....:     get_memory_usage()
    14 ....:     
    15 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    16 0
    17 842.58984375
    18 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    19 0
    20 860.08203125
    21 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    22 37640
    23 876.63671875
    24 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    25 37640
    26 878.2421875
    27 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    28 37640
    29 878.76953125
    30 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    31 37640
    32 880.2421875
    33 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    34 37640
    35 880.2421875
    36 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    37 37640
    38 880.2421875
    39 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    40 37640
    41 880.2421875
    42 Modular Symbols space of dimension 440 for Gamma_1(97) of weight 2 with sign 1 and over Rational Field
    43 37640
    44 880.2421875
     957
     10sage: [x for x in gc.get_objects() if isinstance(x,sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1)]
     11[Modular Symbols space of dimension 49 for Gamma_1(29) of weight 2 with sign 1 and over Rational Field]
     12sage:
    4513}}}
    46 
    47 It would be nice to be able to create modular symbols without needing to restart sage to get all your memory back.
     14So even after garbage collection the modular symbols element is still in memory.