Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect process failed due to out of memory? #8

Open
JanMikes opened this issue May 7, 2021 · 2 comments
Open

How to detect process failed due to out of memory? #8

JanMikes opened this issue May 7, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@JanMikes
Copy link
Member

JanMikes commented May 7, 2021

Sometimes it happens (especially for big codebase) that sub-process is killed due to OOM:

[ 2374.680372] Out of memory: Killed process 10912 (php) total-vm:3659936kB, anon-rss:3551220kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:7156kB oom_score_adj:0

Experienced it on rector sub-process but it can happen for any sub-process: https://github.com/PHPMate/phpmate/blob/master/worker/src/Infrastructure/Symfony/Process/SymfonyProcessRectorBinary.php#L28

Idea is that if this happens, i want to pay extra attention to it, because it can have various outcomes - increase memory, increase swap, optimize process..

Help is wanted - how to detect process failed due to OOM?

@JanMikes JanMikes added the help wanted Extra attention is needed label May 7, 2021
@northys
Copy link

northys commented Sep 20, 2021

just buy more ram =)

@JanMikes
Copy link
Member Author

This could be useful resource: https://github.com/grosser/preoomkiller

Idea: if oom killer exited with specific code, it can be detected afterwards

As well have look at /sys/fs/cgroup/memory/memory.usage_in_bytes and /sys/fs/cgroup/memory/memory.stat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants