Skip to content

gh-151814: Add test for TextIOWrapper.write unbounded memory growth from repeated writes#152244

Open
cmaloney wants to merge 1 commit into
python:mainfrom
cmaloney:gh_151814_test
Open

gh-151814: Add test for TextIOWrapper.write unbounded memory growth from repeated writes#152244
cmaloney wants to merge 1 commit into
python:mainfrom
cmaloney:gh_151814_test

Conversation

@cmaloney

@cmaloney cmaloney commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Use tracemalloc to measure memory usage.

Fails before GH-151817, passes after. Validated by changing condition between > 0 and >= 0 and rebuilding + running make && ./python -m test test_io.test_textio -m "test_write_empty_no_memory_growth".

if (bytes_len > 0) {

Inspired by the report memory usage helper in GH-152203 (If it gets more use should probably move to test.support).

cc: @StanFromIreland

…owth from repeated writes

Use tracemalloc to measure memory usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant