Out of Memory, kill the process or sacrifice your firstborn!
-
@PJH said:
@DoctaJonez said:
@PJH said:
Why don't you RTFA and find out from the first paragraph, instead of treating TDWTF as your own personal Eliza-based search-engine?As with most things arcane in Linux, it's configurable.
Is this behaviour the default? Or has some nutbar actually configured it to do this?
> Hello, I am Eliza. * Is this behaviour the default? Or has some nutbar actually configured it to do this? > Don't you ever say Hello? * Hello. > How are you today.. What would you like to discuss? * Is this behaviour the default? Or has some nutbar actually configured it to do this? > What does that suggest to you?
> Hello, I am Eliza. * Why don't you RTFA and find out from the first paragraph, instead of treating TDWTF as your own personal Eliza-based search-engine? > Perhaps in good time I will RTFA and find out from the first paragraph, instead of treating TDWTF as my own personal Eliza-based search-engine.
Most useless search engine ever.
Also, OOM killer is useful in one case: Android. I'd rather have my music player killed of than the whole system to panic just because I happened to open a certain webpage with a couple megabytes of tags in its source (ahem, ahem). Otherwise, though...
An aircraft company discovered that it was cheaper to fly its planes with less fuel on board. The planes would be lighter and use less fuel and money was saved. On rare occasions however the amount of fuel was insufficient, and the plane would crash. This problem was solved by the engineers of the company by the development of a special OOF (out-of-fuel) mechanism. In emergency cases a passenger was selected and thrown out of the plane. (When necessary, the procedure was repeated.) A large body of theory was developed and many publications were devoted to the problem of properly selecting the victim to be ejected. Should the victim be chosen at random? Or should one choose the heaviest person? Or the oldest? Should passengers pay in order not to be ejected, so that the victim would be the poorest on board? And if for example the heaviest person was chosen, should there be a special exception in case that was the pilot? Should first class passengers be exempted? Now that the OOF mechanism existed, it would be activated every now and then, and eject passengers even when there was no fuel shortage. The engineers are still studying precisely how this malfunction is caused.
-
@anonymous234 said:
@Planar said:
Because 99% is vastly overstating the situation. Looking at one program I'm currently working on, fork() is used in 29 places. Only two of them are immediately followed by one of the exec family of functions.Try this answer: fork() followed immediately by exec(), which probably represents 99% of the uses of fork().
So another question is, why not have a fork_and_exec() call?
-
Then what are you doing with the stuff that you just copied with fork()? I'm ignorant about these matters, so does that mean it's just sleeping until you call upon it or something?
-
@dhromed said:
Setting up the environment before continuing with the child, closing redundant file handles inherited from the parent, spitting out debug, freeing up resources to keep valgrind happy, redirecting stdin/stdout to the parent process - any number of things.Then what are you doing with the stuff that you just copied with fork()? I'm ignorant about these matters, so does that mean it's just sleeping until you call upon it or something?
-
@anonymous234 said:
So another question is, why not have a fork_and_exec() call?
Because handling all the tricky edge cases between the two (like adjusting the environment, changing the working directory, getting a new process group, closing the terminal, etc.) would make the combined fork_and_exec() monstrously complex.Like the corresponding call on Windows (except that also has “child parses command line” too, for extra “giggles”).