I have a number of large (~100 Mb) files which I'm regularly processing. While I'm trying to delete unneeded data structures during processing, memory consumption is a bit too high. so, I was wondering isif there is a way to 'efficiently'efficiently manipulate large data, e.g.:
def read(self, filename):
fc = read_100_mb_file(filename)
self.process(fc)
def process(self, content):
# do some processing of file content
isIs there a duplication of data structures? isn'tIsn't it more memory efficient to use a class-wide variableattribute like self.fc?
how toWhen should I use garbage-collect collection? I know about the gc module, but do I call it after iI del fc for example? does garbage collector called after a del statement at all? when should I use garbage collection?
update
p.s. 100 Mb is not a problem in itself. but float conversion, further processing add significantly more to both working set and virtual size (i'mI'm on windowsWindows).