liamk-ultraL
Apify & Crawlee6mo ago
7 replies
liamk-ultra

Memory access problem on MacOS

I'm deploying on Linux, but my development system is MacOS.
I discovered an issue that appears with concurrency > 2.
I have plenty of memory but that's not actually the problem;, but in any case it should probably fail gracefully.

The Snapshotter tries to access child process memory via
psutil.Process.memory_full_info()
,
which requires elevated permissions on macOS and fails with
psutil/_psosx.py", line 356, in wrapper

    raise AccessDenied(self.pid, self._name)


I came up with a monkey patch workaround, so this is not a pressing issue. Just thought I'd mention it in case anyone else encountered it, or a fix could be incorporated in the code.
Solution
I think it is a bug introduced when improving memory usage estimation on Linux. Unfortunately we have tests only for Windows and Linux in CI, so macOS support is kind of fragile. Thanks for reporting it I will take a look into that
https://github.com/apify/crawlee-python/issues/1329
GitHub
It seems that fix: Use PSS instead of RSS to estimate children process memory usage on Linux introduced bug for MacOS as the memory_full_info might not be available there without some elevated priv...
Memory estimation problem on MacOS · Issue #1329 · apify/crawlee-...
Was this page helpful?