4 ms·
Oh please, say more, it seems very interesting. I didn't really get the last two bullet points
by somethingsome 1y ago
Oh please, say more, it seems very interesting.
I didn't really get the last two bullet points
- mmastrac 1y agoI think they are describing a "balloon" - you allocate enough memory to trigger a low-memory condition. Android then tries to kill off any large apps. You can then allocate large amounts of RAM in your own app after giving Android some time to shut down background apps, etc.
- zero_shift 1y agoThis reminds me of those "memory freer" apps they used to distribute for Windows XP. Did they actually do anything useful? Or just force Windows to write everything to the pagefile?
- swinglock 1y agoThat could perhaps be a useful if you had just enough memory to run a game, if not for other processes using it too. In that case background services should be written to swap while running the game which will probably cause stutters. Doing it before starting the game instead would be better, if it has to be done. So such a utility might then be useful in some cases when someone couldn't afford enough RAM.
- sim7c00 1y agois this thre term, baloon? like baloon drive? some vm stuff, i suddenly thought it may serve similar purpose before starting a VM, those can have big memory to load in. makes sense but this is a total guess from your use of baloon. any idea by chance? :D
- mmastrac 1y agoThat's literally it. Inflate the balloon, squeeze ram, you're good to go.
- AnotherGoodName 1y agoWhen you spawn a child process you can catch the OS level events acting on the process. These are called Signals. https://unix.stackexchange.com/questions/176235/fork-and-how-signals-are-delivered-to-processes https://unix.stackexchange.com/questions/176235/fork-and-how... If you wish to exit gracefully in some way (eg. cleanup) you can catch SIGINT and SIGTERM in a function in the parent process. Signals propagate unless caught. This way you can avoid the parent process (imagine a UI visible to the user) dying if you have a subprocess (memory intensive video encoding) terminated by the OS. Signals are undertaught in CS honestly.
- cryptonector 1y agoEr, no. You cannot catch in one process a signal posted to another. I think you might be confusing signals generated by the tty/pty, which go to the foreground process group, and signals generated by the kernel for OOMs (which go only to the victim process, not the whole group). What you can do is see what signal a child process died with (see the `wait*(2)` system calls), and with cgroups you can find out about OOM kills of processes in a cgroup, but you still can't "catch" the signal and hold the victim alive and its memory allocated for a bit.
- AnotherGoodName 1y ago>If you don't define an interrupt handler (or explicitly ignore the signal), both processes would just exit with a SIGINT code (the default behaviour). That's what i mean by catching it. You either trap signal or you have the parent process exit too. The goal is to avoid the parent dying and the OS messaging the user "process killed for too much memory" which happens without the trap. The trigger for memory is separately just to hit a failed malloc in a loop.
- somethingsome 1y agoThank-you both, that was what I was missing. I didn't use signals in programming in many many years, and the 'catching' of signals was the most bothering to me.