def METHOD_NAME(self):
    memory_usage_in_bytes = psutil.Process(self._pid).memory_info()[0]
    if memory_usage_in_bytes > self._max_memory_usage_in_bytes:
        bytes_per_mib = 1_048_576
        raise Exception(
            softwrap(
                f"""
                pantsd process {self._pid} was using {memory_usage_in_bytes / bytes_per_mib:.2f}
                MiB of memory (above the `--pantsd-max-memory-usage` limit of
                {self._max_memory_usage_in_bytes / bytes_per_mib:.2f} MiB).
                """
            )
        )