Skip to contentSkip to conversation

Say that it was Linux that printed "Out of memory"

DISCUSSION Dan Jacobson 3 participants 5 messages Nov 26, 2023 Stable branch

lore
Share & tools
lore
#1 lore raw
Quoted 6 lines · Dan Jacobson

In https://github.com/szabgab/perlmaven.com/issues/583 we see to find the simple answer to "What printed 'Out of memory', one must consult the experts.

Therefore the "Out of memory" message needs to be prefixed with the name of the kernel, or something. Anything. Thanks.

Prefixed exactly where? The kernel already does report all of this to the kernel log, saying what program was killed due to out of memory issues.

thanks,

greg k-h

#2 lore raw
Quoted 11 lines · Greg KH
Quoted 6 lines · Dan Jacobson

In https://github.com/szabgab/perlmaven.com/issues/583 we see to find the simple answer to "What printed 'Out of memory', one must consult the experts.

Therefore the "Out of memory" message needs to be prefixed with the name of the kernel, or something. Anything. Thanks.

Prefixed exactly where? The kernel already does report all of this to the kernel log, saying what program was killed due to out of memory issues.

From what I can see on the original article featuring a simple perl script at https://perlmaven.com/out-of-memory it says "on the terminal". As such, it's just the perl interpreter that faced ENOMEM and printed the corresponding message before quitting. One will note that there is absolutely no capture provided in the article nor the reporter to ease understanding, but as a rule of thumb the kernel will not print stuff in the user's terminal, it will only appear in logs where it's indeed prefixed. And no need for an "expert" to figure that ;-)

Willy

#4 lore raw
In reply to Greg KH

Prefixed to STDERR, right before the words Out of Memory.
Well at least bash error messages make it clear they are from bash. Perl is in the habit of assuming everybody knows its messages come from perl. And now the kernel assumes people can guess they come from the kernel. Anyway, I bet half the people who see this message,
https://www.google.com/search?q=perl+out+of+memory
assume it is perl making it.
And... not everybody looks or can look at kernel logs.