def leakage(Cls, *args, **kwargs):
 mem = []
 for i in range(100):
  Cls(*args, **kwargs)
  mem.append(info.getMemoryUsage())
  if ((mem[i] - mem[0]) > THRESHOLD):
   break
 proportion = (i / 99.0)
 return round(((mem[i] - mem[0]) / proportion), 1)

def leakage ( Cls , * args , ** kwargs ) : mem = [ ] for i in range ( 100 ) : Cls ( * args , ** kwargs ) mem . append ( info . getMemoryUsage ( ) ) if ( ( mem [ i ] - mem [ 0 ] ) > THRESHOLD ) : break proportion = ( i / 99.0 ) return round ( ( ( mem [ i ] - mem [ 0 ] ) / proportion ) , 1 )
make up to 100 instances of cls .