Skip to content

AttributeError: 'Process' object has no attribute 'memory_maps' #228

Description

@Alecyrus

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions