0

I sometimes open PDF's and then want them "sort of" open "to read later", but I'm not looking at them at the moment. While I'm not looking at them I'd like the OS to spend less effort keeping them up.

In other words I'd like the OS to allocate resources away from some evince windows and toward other things I'm running.

I just learnt of dtach in another context. Is either dtach or renice an appropriate program to "downshift" the processes I'd like to deprioritise? I've looked at some of the documentation but since this is perhaps a nonstandard usage of the tools I can't tell if they're right for my goal.

2

dtach does not influence OS resources in the sense that it reduces RAM or CPU cycles, dtach detaches a process from it's parent process. renice on the other hand increases / decreases the priority of the process for the schedular; the process will gain more cpu-cycles .

So: yes, you can use dtach to detach evince from your xterm (I doubt that you open evince via xterm anyway). This would only ensure that closing xterm won't close evince. Yes, you can renice a lower priority to evince and then the scheduler will call evince less often. Memory wise there won't be any change at all. To reduce work load you might minimize evince so it is not visible and thus nothing new will be rendered and no checks against overlapping due to other programms will take place.

But, and I mean that in all seriousness: Stop fiddling around with your system in such micromanagement style and just buy more RAM. As long as you don't open 1000s of evince to be read later (which is a usage pattern I would change in the first place) the OS will behave not really differently when you microtune the OS. If you don't want to read the .pdfs now: save them to disk. Problem solved.

  • Well, I have 16GB. But it seems I can never get enough RAM. I know I could change my behaviour but the goal is to be able to use the machine as I want to. – isomorphismes Feb 17 '14 at 7:15
  • 2
    You do not want to outclever the OS in regards of how things work manually. Really. Unused RAM is useless. Having files cached in RAM is good, they will go out of RAM if OS decides that it needs more RAM for a given process. I once (out of curiosity) fread() a file to fill my own buffers and it made no difference whatsoever. Let the OS do it's job on it's own, OS devs usually are way smarter than you are and came up with good algorithms which work well for the majority of situations you might come across. – akira Feb 17 '14 at 7:30
  • I hear you. Although I wonder if my usage patterns are so out-there that they count as edge cases the OS (kernel?) designers wouldn't plan for. Case in point: when I use Chromium I shift+Esc to kill most of my tabs. Google devs are smarter than I am, but they assume I would have fewer tabs open than I typically do. I guess most users top out ~20 and would prefer those 20 to be faster; not me. Thanks for your answer and comment. – isomorphismes Feb 17 '14 at 8:48
  • I don't understand your Chromium problem: I have 30 tabs open and this sums up to just roughly 1gb of RAM. – akira Feb 17 '14 at 11:15
  • I will typically have much more than 30 tabs open. – isomorphismes Feb 17 '14 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.