Bug report
Bug description:
Printing the empty string in a loop seems to cause memory use of Python to grow without bound.
while True:
print('', end='')
or
import sys
while True:
sys.stdout.write('')
The latter apparently does not work in interactive mode.
Relatedly,
while True:
for _ in range(10**8):
print('', end='')
print()
causes memory use to grow to about 1.5GB and then reset when the newline is printed.
CPython versions tested on:
3.14, 3.11, 3.13
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
Printing the empty string in a loop seems to cause memory use of Python to grow without bound.
or
The latter apparently does not work in interactive mode.
Relatedly,
causes memory use to grow to about 1.5GB and then reset when the newline is printed.
CPython versions tested on:
3.14, 3.11, 3.13
Operating systems tested on:
Linux
Linked PRs
io.TextIOWrapper#151817