AttributeError: 'Process' object has no attribute 'memory_maps'
Alecyrus opened this issue · 1 comments
Alecyrus commented
Platform: macOS 10.15.5
# worker.py
def get_memory(self):
mmaps = self.process.memory_maps()
mem = {
"rss": sum([x.rss for x in mmaps]),
"swap": sum([getattr(x, 'swap', getattr(x, 'swapped', 0)) for x in mmaps])
}
mem["total"] = mem["rss"] + mem["swap"]
return mem
psutil documentation says that memory_maps()
:
Availability: Linux, Windows, FreeBSD, SunOS
Changed in version 5.6.0: removed macOS support because inherently broken (see issue #1291)
So, I got AttributeError: 'Process' object has no attribute 'memory_maps'
when runing mrq-worker
on macOS.
This limitation should be declared in the documentation.
sylvinus commented
Thanks!