class a(): def __init__(self): fp = open("a_file_lager_1M","rb") self.ll = fp.read() fp.close() self.h = b(self.aaa) def aaa(self): pass class b: def __init__(self,bbb): self.a = bbb #remove the "self.", the memory use will be very low! pass def c(): k=a() while True: c()