Test de saturation de la mémoire
from random import randint # https://tiplanet.org/forum/viewtopic.php?f=100&t=23539&p=267762#p267574 def fill_memory(n): tab = [] i = 0 while True: try: tab.append(randint(1,n)) i += 1 except: print(i, "val entre 1 et",n) break def fill_memory_bis(n): tab = [] i = 0 while True: try: tab.append(2**32+randint(1,n)) i += 1 except: print(i, "val entre 2**32 et",2**32+n) break fill_memory(2**2) #4096 fill_memory(2**5) #4096 fill_memory(2**8) #4096 fill_memory(2**16) #4096 fill_memory(2**32) #0 fill_memory(2**64) #0 fill_memory_bis(2**16) #256