nvflare.fuel.utils.mem_utils module

log_rss(tag: str) None[source]

Log process RSS memory if NVFLARE_CLIENT_MEMORY_PROFILE env var is set.

Zero-overhead no-op when not enabled — only cost is a single boolean check. psutil is imported lazily so it is not a hard dependency. In subprocess mode, ExProcessClientAPI.init() loads log_config.json before any receive/send calls, so logger.info() is fully configured by the time this function runs.

Usage:

NVFLARE_CLIENT_MEMORY_PROFILE=1 python train.py
Parameters:

tag – label for the log line, e.g. "round=3 after_send"