Richard W.M. Jones
2023-Jun-01 11:18 UTC
[Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
[Sorry, not read the other replies yet, in meetings all day today] On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote:> To start with I have opened a discussion topic. We can think about > opening bugs later. > > https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreachable-objects/12281There were some replies to this thread. One open merge request is notable - it adds compaction back: https://github.com/ocaml/ocaml/pull/12193 although only for "small" blocks, less than 128 * 8-byte words, which probably covers everything we do. It seems like full_major is the way to force freeing of unreachable objects, in all versions of OCaml. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Laszlo Ersek
2023-Jun-01 11:26 UTC
[Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
On 6/1/23 13:18, Richard W.M. Jones wrote:> [Sorry, not read the other replies yet, in meetings all day today] > > On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote: >> To start with I have opened a discussion topic. We can think about >> opening bugs later. >> >> https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreachable-objects/12281 > > There were some replies to this thread. One open merge request is > notable - it adds compaction back: > > https://github.com/ocaml/ocaml/pull/12193 > > although only for "small" blocks, less than 128 * 8-byte words, which > probably covers everything we do.We likely don't have a structure type larger than 1KB :)> It seems like full_major is the way to force freeing of unreachable > objects, in all versions of OCaml.Ah, does that mean we don't need a version check here, after all? IIRC, you said that in OCaml 4, "compact" was a superset of "full_major". If "full_major" is sufficient for finalizing unreachable objects on OCaml 4 too, then we can downgrade "compact" to "full_major" regardless of OCaml version. Laszlo