def METHOD_NAME(self):
    size = self.resource.getrusage(self.resource.RUSAGE_SELF).ru_maxrss
    if sys.platform != "darwin":
        # on macOS ru_maxrss is in bytes, on Linux it is in KB
        size *= 1024
    return size