MEM_DIM = 1024*1024*16 a = [] allocato = 0 while(True): try: buf = ['x'] * MEM_DIM a.append(buf) allocato += MEM_DIM print 'Mb = %10d' % (allocato/1024/1024) except MemoryError, e: print e