Skip to content

Instantly share code, notes, and snippets.

@deven96
Last active March 24, 2022 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deven96/982ee63cf1ced56e5d7a9f861c81219c to your computer and use it in GitHub Desktop.
Save deven96/982ee63cf1ced56e5d7a9f861c81219c to your computer and use it in GitHub Desktop.
Deleting large array
from memory_profiler import profile
@profile
def my_func():
a = [1] * (10 ** 6)
b = [2] * (2 * 10 ** 7)
c = b[200000]
del b
return a.append(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment