5 ms·
Probably lack of integration; if NT hits a memory issue, it can just pass notice to the tightly-coupled userland and GUI. If Linux runs out of memory, even if i
by yjftsjthsd-h 7y ago
Probably lack of integration; if NT hits a memory issue, it can just pass notice to the tightly-coupled userland and GUI. If Linux runs out of memory, even if it internally knows what process to blame... What would it do that makes sense for a headless server, TiVo, and Android phone? Keeping in mind that the kernel folks don't even work that closely with many userspace vendors.
- useerup 7y agoWindows (server and desktop versions) will throw up a message dialog on the screen. It will also start to kill off processes just enough to resolve the low memory situation. During this - unlike Linux - you can actually use the mouse, CLI and close programs yourself. On top of that server applications like IIS has built-in watchdogs. If an IIS process grows to use too much memory (60% IIRC) or excessive CPU, the watchdog will recycle the process.
- StreamBright 7y agoI think Windows kernels do not use overcommit, so memory allocation will fail if you run out of memory.
- chacham15 7y agoThrow a signal like it would do if the process were out of memory completely and about to be killed? (for clarification, no snark intended, actual question)
- saagarjha 7y agoWhat signal is sent when a process is out of memory? I thought malloc would either start returning NULL or you’d fault when trying to access overcommitted memory.
- joosters 7y agoYes, but ideally you want to be throwing some ‘memory pressure’ signals before absolutely running out of memory, so that programs can take simple actions like emptying caches, etc. Catching an otherwise-fatal out-of-memory fault and recovering would be too complicated / bug-prone.
- pjmlp 7y agoAndroid sends low memory events and kills processes based on heuristics. Then again, Android has a customized Linux kernel.
- wiml 7y agoOSX handles this with a kqueue event that can notify userland when the system moves between various memory pressure states; this is hooked into by libdispatch and other userland libraries which will discard caches and so on. I don't see why Linux couldn't do the same; open /sys/kernel/something and epoll on it.
- antientropic 7y agoThis already exists: applications can receive memory pressure events (such as the system reaching "medium" level, where you may want to start freeing some caches) via /sys/fs/cgroup/memory/.../memory.pressure_level. See https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt https://www.kernel.org/doc/Documentation/cgroup-v1/memory.tx....
- packetized 7y agoThe first two nota benes explicitly describe this document being outdated and not what most people expect when it comes to “memory controller”. I am not certain that citing this is a great example.
- Sean1708 7y agoWhat about this? Seems to do what they want. https://serverfault.com/a/949045 https://serverfault.com/a/949045
- deleted 7y ago[deleted]
- Asooka 7y agoYou could use the message bus to post a message to the service that handles out of memory decisions, which in turn could either 1. Show a GUI with a choice 2. Show a message on the current terminal and ask what to do 3. Just return "kill it now" if there is no interactive session And if there is no such service, just default to 3. The problem really is that the state cannot be captured and communicated to the user. I doubt the NT kernel itself shows a GUI window, it's probably a service that gets woken up by a kernel exception, which in turn shows the window. Basically, the Linux kernel needs more pluggable functionality for user interactions. It's absolutely fine and even recommended to not have an entire GUI in the kernel, it needs to just provide a mechanism for userspace to capture the event and decide what to do with it.
- jcfrei 7y agoThis describes my general Linux experience well: A very stable kernel, with which I never had serious issues on a headless server. But applications in the userspace (apart from the standard GNU packages) are usually a tossup anywhere between system-crashing garbage and perfectly working pieces of software.