{"id":13586248,"url":"https://github.com/ALinuxPerson/oom-notifier","last_synced_at":"2025-04-07T15:31:24.290Z","repository":{"id":57448903,"uuid":"270941285","full_name":"ALinuxPerson/oom-notifier","owner":"ALinuxPerson","description":"A libray/program that gives information about oom scores","archived":false,"fork":false,"pushed_at":"2022-02-04T12:06:50.000Z","size":64,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-14T22:10:12.235Z","etag":null,"topics":["library","linux","linux-kernel","module","oom","process","processes","program","python","python-library","python-module","python-program","python-script","script"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALinuxPerson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-09T08:08:01.000Z","updated_at":"2022-02-04T12:06:53.000Z","dependencies_parsed_at":"2022-09-16T13:53:01.551Z","dependency_job_id":null,"html_url":"https://github.com/ALinuxPerson/oom-notifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Foom-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Foom-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Foom-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Foom-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALinuxPerson","download_url":"https://codeload.github.com/ALinuxPerson/oom-notifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247679416,"owners_count":20978045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","linux","linux-kernel","module","oom","process","processes","program","python","python-library","python-module","python-program","python-script","script"],"created_at":"2024-08-01T15:05:25.597Z","updated_at":"2025-04-07T15:31:23.983Z","avatar_url":"https://github.com/ALinuxPerson.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# oom-notifier\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![PyPI download week](https://img.shields.io/pypi/dw/oom-notifier.svg)](https://pypi.python.org/pypi/oom-notifier/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/oom-notifier.svg)](https://pypi.python.org/pypi/oom-notifier/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/oom-notifier.svg)](https://pypi.python.org/pypi/oom-notifier/)\n\n![product-library](https://i.imgur.com/9ztbONM.png) ![product-notfication](https://i.imgur.com/6oWvzV4.png) ![product-wall](https://i.imgur.com/Xps47Xa.png)\n\noom-notifier is a program and a library used to track oom scores for Linux.\n\n## Description\n\noom-notifier gets the oom score of each process by getting the `/proc/\u003cPID\u003e/oom_score` value. As a program, it tracks\nthe oom scores of each process (by default) every 5 seconds and the threshold is set to 1000. If you want to change these\nvalues, refer to the configuration header below.\n\nBut what is an `oom_score`?\n\nAn `oom_score` is basically a score assigned to a process by the Linux kernel which is the likelihood that a process will\nbe terminated in case a computer is out of memory. If a process oom score is high, it means it will be one of the first processes to be killed in case\nof low memory resources. If a process oom score is low, it means it will be the least likely to be killed in case of low memory\nresources.\n\n## Getting Started\n\n### Dependencies\n\n* Any Linux-based distribution\n* Python\u003e=3.6\n* pip\n\n### Installing\n\n1. Install `oom-notifier` using pip.\n```bash\n$ pip install oom-notifier\n```\n\n### Usage\n\nAs a library:\n```python\nimport oom_notifier\n\noom = oom_notifier.OOM()\n\n# to get all pids and oom scores of each process, use this:\nall_oom_scores = oom.info  # this is a dictionary\n\n# to get the maximum oom score of all processes, use this:\nmax_oom_score = oom.max  # this is also a dictionary\n```\nAs a program:\n```bash\n$ oom-notifier  # launches oom-notifier in the background\n```\n\n### Configuration\nIn `~/.config/oom-notifier/config.ini`:\n```ini\n[Main]\n; this sets the threshold to where oom-notifier will trigger a notification if it passes this value\nthreshold = \u003cNUMBER_HERE\u003e\n; this sets the time where oom-notifier will wait to refresh the oom-scores\nwait_time = \u003cNUMBER_HERE\u003e\n```\n\n## Help\n\n#### **`oom-notifier` only displays in the command line**\n\nThis usually means that the dbus can't contact the notification service (as, internally, `dbus-python` raises an exception incase of failure).\nAFAIK, most of the time the reason this happens is because the notification service isn't installed.\n\nIn XFCE:\n\nCheck if `xfce4-notifyd` is running in the background.\n```bash\n$ ps cax | grep xfce4-notifyd\n```\nif there's no output, it means xfce4-notifyd isn't running and means it isn't started or isn't installed. If it isn't installed,\nyou can install using your distribution's package manager.\n\n## License\n\nThis project is licensed under the [GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/) License - see the [LICENSE](https://github.com/ALinuxPerson/oom-notifier/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FALinuxPerson%2Foom-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FALinuxPerson%2Foom-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FALinuxPerson%2Foom-notifier/lists"}