How to sacrifice a certain program in the case of OOM?
On low-RAM, swapless systems, OOM error makes system hang for a while. It accesses the system disk device heavily (BTW I wonder why, there is no swap and no way to get memory from nothing — so what is it hopes and tries for?), and, at last, OOM killer does it's job.
How can I execute pkill -9 scapegoat_program_name every time memory allocation fails? I want to kill the least needed process first. And activate the common OOM solutions only if it didn't help.
If it's impossible, I want to give the scapegoat PID to the OOM killer before any troubles occur (in order to make OOM killer begin with the scapegoat). But it takes way to long before the OOM killer starts. I want to make the scapegoat sacrifice the first thing my system do and avoid that long freeze.
kernel ram
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 4 more comments
On low-RAM, swapless systems, OOM error makes system hang for a while. It accesses the system disk device heavily (BTW I wonder why, there is no swap and no way to get memory from nothing — so what is it hopes and tries for?), and, at last, OOM killer does it's job.
How can I execute pkill -9 scapegoat_program_name every time memory allocation fails? I want to kill the least needed process first. And activate the common OOM solutions only if it didn't help.
If it's impossible, I want to give the scapegoat PID to the OOM killer before any troubles occur (in order to make OOM killer begin with the scapegoat). But it takes way to long before the OOM killer starts. I want to make the scapegoat sacrifice the first thing my system do and avoid that long freeze.
kernel ram
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only/and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"
– Sergiy Kolodyazhnyy
8 hours ago
1
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
1
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago
|
show 4 more comments
On low-RAM, swapless systems, OOM error makes system hang for a while. It accesses the system disk device heavily (BTW I wonder why, there is no swap and no way to get memory from nothing — so what is it hopes and tries for?), and, at last, OOM killer does it's job.
How can I execute pkill -9 scapegoat_program_name every time memory allocation fails? I want to kill the least needed process first. And activate the common OOM solutions only if it didn't help.
If it's impossible, I want to give the scapegoat PID to the OOM killer before any troubles occur (in order to make OOM killer begin with the scapegoat). But it takes way to long before the OOM killer starts. I want to make the scapegoat sacrifice the first thing my system do and avoid that long freeze.
kernel ram
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
On low-RAM, swapless systems, OOM error makes system hang for a while. It accesses the system disk device heavily (BTW I wonder why, there is no swap and no way to get memory from nothing — so what is it hopes and tries for?), and, at last, OOM killer does it's job.
How can I execute pkill -9 scapegoat_program_name every time memory allocation fails? I want to kill the least needed process first. And activate the common OOM solutions only if it didn't help.
If it's impossible, I want to give the scapegoat PID to the OOM killer before any troubles occur (in order to make OOM killer begin with the scapegoat). But it takes way to long before the OOM killer starts. I want to make the scapegoat sacrifice the first thing my system do and avoid that long freeze.
kernel ram
kernel ram
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago
NickDoomNickDoom
315
315
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
NickDoom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only/and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"
– Sergiy Kolodyazhnyy
8 hours ago
1
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
1
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago
|
show 4 more comments
1
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only/and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"
– Sergiy Kolodyazhnyy
8 hours ago
1
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
1
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago
1
1
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only
/ and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"– Sergiy Kolodyazhnyy
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only
/ and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"– Sergiy Kolodyazhnyy
8 hours ago
1
1
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
1
1
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
NickDoom is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121763%2fhow-to-sacrifice-a-certain-program-in-the-case-of-oom%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
NickDoom is a new contributor. Be nice, and check out our Code of Conduct.
NickDoom is a new contributor. Be nice, and check out our Code of Conduct.
NickDoom is a new contributor. Be nice, and check out our Code of Conduct.
NickDoom is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121763%2fhow-to-sacrifice-a-certain-program-in-the-case-of-oom%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This is for Unix & Linux. Ubuntu doesn't run on low RAM swapless systems.
– Pilot6
8 hours ago
@Pilot6 a watt ?! So Ubuntu cannot be installed with custom partitioning of only
/and no swap and PC that has only 1GB RAM ?! Then how was I able to do that on my 10 year-old laptop ?! Alexa this is so sad, play "Despacito"– Sergiy Kolodyazhnyy
8 hours ago
1
It is possible but doesn't meet minimal requirements. Running on 1GB without swap is not supported.
– Pilot6
8 hours ago
@Pilot6 It's totally possible to run Ubuntu without swap, and it's equally possible to run out of memory with swap enabled. I see no reason why this is off topic here.
– vidarlo
7 hours ago
1
Some reasons: 1) OP never mentioned Ubuntu; 2) question isn't Ubuntu specific; 3) it's unlikely very useful for Ubuntu users. So U&L is a better place for it.
– Pilot6
7 hours ago