mirage / ocaml-solo5

Freestanding OCaml runtime
Other
101 stars 30 forks source link

Free memory estimation failed (again) ? #132

Closed palainp closed 6 months ago

palainp commented 6 months ago

With qubes-mirage-fw, even with the latest release I still have a negative free memory value. The free memory is computed at https://github.com/mirage/mirage-xen/blob/d1ee224fbdaa79bd4c1136a80c4594c454d12c27/lib/memory.ml#L44 as heap words minus live words minus stafk words.

Before saying something is wrong again in malloc_memory_footprint I'll try to double check with the classical malloc_footprint :)

hannesm commented 6 months ago

which version of ocaml-solo5 is this with?

palainp commented 6 months ago

This was with 0.8.3 unfortunately (I confirmed by looking into the asm code to check if memory_usage was correctly modified in realloc, which it was) :(

palainp commented 6 months ago

So the mallinfo values seem to be correctly reported (i.e. no negative free memory). I'm surprised to have not seen that before, now it seems to be really bad really quickly (in less than a minute after starting qubes-mirage-fw, and maybe it's related to the Qubes environment as it doesn't seem to be present elsewhere).

palainp commented 6 months ago

Surprisingly I'm unable to reproduce this behavior now, so closing (the right time to finish with "I'll be back"?)