#!/urb/bin/env python
# -*- coding: utf-8 -*-

import gc
from weakref import ref

from gi.repository import Gtk, GObject

def gen_store():
    #st = Gtk.ListStore(*[str]*5)
    st = Gtk.ListStore.new([GObject.TYPE_STRING]*5)
    for r in range(10000):
        #st.append(['Aaaaaaa', 'Bbbbbbb', 'Ccccccc', 'Ddddddd', 'Eeeeeee'])
        i = st.append()
        st.set_value(i, 0, 'Aaaaaa')
        st.set_value(i, 1, 'Bbbbbbb')
        st.set_value(i, 2, 'Ccccccc')
        st.set_value(i, 3, 'Ddddddd')
        st.set_value(i, 4, 'Eeeeeee')
    return st

def boo():
    for i in range(10):
        input('Press <Enter> ...')
        store = ref(gen_store())
        gc.collect()
        print(store())


if __name__ == '__main__':
    boo()
