You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
269 B
13 lines
269 B
# test out-of-memory with malloc
|
|
l = list(range(1000))
|
|
try:
|
|
1000000000 * l
|
|
except MemoryError:
|
|
print('MemoryError')
|
|
print(len(l), l[0], l[-1])
|
|
|
|
# test out-of-memory with realloc
|
|
try:
|
|
[].extend(range(1000000000))
|
|
except MemoryError:
|
|
print('MemoryError')
|
|
|