I try to use libarchive to create some archives. I use directly an example from wiki. Problem is that it stores everything in memory until archive_write_free is called. Simple measurement: adding about 2000000 x 1.5KB of random ascii buffers (as 7zip) stores ~350MB in memory, without single write into disc. I tried archive_write_open callback-version and write callback was never called until archive_write_free.
Do you know any way to force libarchive to flush data in progress? or set some memory limit? or how to measure in runtime how much it allocated (I could close it, rotate file, and open new one)?
PS. I tried libarchive 3.2.2 from official Ubuntu 18.4 bundle and 3.6.1 from repo, both the same results.
It seems that it is a bug/feature of
archive_write_set_format_7zip. Whengziporxzfilter used then data are dumped frequently into disc as expected. I have reported an issue, maybe I will get more info there.