Open BimDav opened 2 years ago
This is probably not a memory leak, there should just be a way to periodically free the buffer used for compression.
open
is not reading any data, only creating the file handle.open_compressed
(for read) is decompressing full file contents into a memory buffer when opening.open_compressed
(for write) creates a memory buffer and will only compress and write to file when it is closed.
open_compressed
(for write) creates a memory buffer and will only compress and write to file when it is closed.
Good to know! Is there (should there be) a way to use flush() to compress and write to file on demand?
Is there (should there be) a way to use flush() to compress and write to file on demand?
No, compressed file can be written and read at arbitrary position, and it won't work with on demand compression (in this case data can be only appended at the end).
Godot version
3.5.1-stable
System information
MacOS, M2
Issue description
When writing to a file after using open_compressed(), the memory usage increases. If the file is open using open(), memory usage is constant. This is probably not a memory leak, there should just be a way to periodically free the buffer used for compression. Using flush() periodically does not solve the issue.
Steps to reproduce
Open a file using open_compressed and write to it in _process(), for example
Minimal reproduction project
test_compression.zip