Skip to content

Instantly share code, notes, and snippets.

@RantyDave
Created June 24, 2017 05:40
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 RantyDave/c2322891f86f26f4696b3a8b3a478b62 to your computer and use it in GitHub Desktop.
Save RantyDave/c2322891f86f26f4696b3a8b3a478b62 to your computer and use it in GitHub Desktop.
Incrementally allocating memory
import sys
base_alloc = bytearray(int(sys.argv[1])*1024*1024*1024)
extensions = []
while True:
print("Append 128MB")
sys.stdin.readline()
extensions.append(bytearray(128*1024*1024))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment