It seems that there is still no replacement for memory.memsw.max_usage_in_bytes, so there is no way to read maximum swap usage. This should be acceptable for using isolate as a contest sandbox, where swap is supposed to be disabled for ensuring reproducibility.
So perhaps it would for now be sufficient to leave it like this, and add proper documentation that swap memory is not accounted for. On a related note, I am not sure how obvious it was that with v1 the reported memory usage was the maximum of memory peak and swap memory peak, which I assume could be smaller than the peak of the total memory consumption, so clarifying how or if swap memory consumption is regarded might be good either way.
Use
memory.peak
, which replacesmemory.max_usage_in_bytes
from v1.See https://github.com/ioi/isolate/issues/78#issuecomment-1221414436.
It seems that there is still no replacement for
memory.memsw.max_usage_in_bytes
, so there is no way to read maximum swap usage. This should be acceptable for using isolate as a contest sandbox, where swap is supposed to be disabled for ensuring reproducibility.So perhaps it would for now be sufficient to leave it like this, and add proper documentation that swap memory is not accounted for. On a related note, I am not sure how obvious it was that with v1 the reported memory usage was the maximum of memory peak and swap memory peak, which I assume could be smaller than the peak of the total memory consumption, so clarifying how or if swap memory consumption is regarded might be good either way.