Clear memory in python loop -


how can clear memory in python loop ?

import concurrent.futures futures futures.threadpoolexecutor(max_workers=100) executor:     fs = [executor.submit(get_data, url) url in link]     i, f in enumerate(futures.as_completed(fs)):         x= (f.result())         results.append(x)         del x          del f 

get_data - simple function wich using requests

i think had same problem recently, answer not del introducing sleep func... try;

import time import concurrent.futures futures futures.threadpoolexecutor(max_workers=100) executor:     fs = [executor.submit(get_data, url) url in link]     i, f in enumerate(futures.as_completed(fs)):            x= (f.result())            results.append(x)            time.sleep(n_seconds) 

or (i used while loop on list of urls)


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -