Comments (5)
#3 is sort of related, and on its way to being solved.
I think .close()
would have similar effect on memory consumption, as all buffers are released, but worth checking.
from stdio-mgr.
In most modern contexts, for anything but the most ridiculous of large streams, I can't imagine this Issue is likely to be a big issue. Seems very YAGNI.
Especially with the changes from #25 and #26, though -- as you noted at the bottom of #26, the mocked stream objects are now storing internal references to the underlying buffers in some situations, and that could lead to memory accumulation if enough things stay in scope/have references.
from stdio-mgr.
Although -- both RandomTextIO
and TeeStdin
store a reference to the buffer in ._buf
... as long as the (i, o, e)
objects remain in scope, I would think they will retain references to their ._buf
s the whole time, even after .close()
or .detach()
, right?
I guess .close()
frees the actual buffer memory, so in that case it is just ._closed_buf
to worry about in terms of memory consumption.
But for .detach()
, I'd think it would still matter -- though, if someone is .detach()
-ing, they likely still want to work with the stream data, and so it would probably be a total footgun to wipe the buffer after just a .detach()
.
So, yeah: just ._closed_buf
to worry about, then.
from stdio-mgr.
With #58 switching the persisted-content mechanism from ._closed_buf
to a callback, this issue should be moot.
from stdio-mgr.
I think we at least need tests for this, and it turns out to be very important to delete objects when using TemporaryFile and when using the real sys handles.
from stdio-mgr.
Related Issues (20)
- Option to pass output through to original stdout/stderr
- Reset default branch to post-1.0.1 release and migrate to `main`
- Find project admin work that cleanly follows #101 and cherry pick
- Convert v2.0 plan to 1+ projects
- Develop system of labels for the v2.0 issues/tasks
- Wrapping `print` builtin
- Replace buffers inside of existing sys.std* wrappers HOT 4
- Add new CI job testing coverage of tests folder
- Option to normalise Windows EOL HOT 3
- Test alternative Python implementations HOT 16
- Create ABC for .getvalue HOT 5
- Assertion helpers for `.getvalue()` HOT 1
- Document prior art HOT 6
- unittest compatible subset of test suite
- Disable (subset of) comparison dunder methods inherited from tuple HOT 1
- High-level v2.0 plan
- MicroPython implementation and tests HOT 4
- Add option to scrub ANSI and Win console command codes
- pytest-subtests prevents stdio_mgr from capturing stdio
- 1.0.1: pytest based test suite is failing: move README tests out of main test suite HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stdio-mgr.