0

I sometimes have a memory and CPU hungry app running (for example MediathekView) and want to start another (for example FlightGear) (both from terminal, if that matters). If I just start both, my PC freezes after some seconds with full RAM, the hard disk lamp bright on all the time and full CPU. One possible solution could be to temporarily move the RAM pages of MediathekView to hard disk and then restore them later, similar to preventing MediathekView from eating my CPU by simply hitting Ctrl+Z, and restoring the process later by executing %. Is the same possible for the RAM ? If not, what else could I try ?

If it matters : I have 4GB RAM, where 1GB is always consumed by FireFox, MediathekView needs 1,5 GB and FlightGear needs 2,5 GB.

TheEagle
  • 143
  • Memory management is best left to the operatin system unless you enjoy crashing computers. Information that is stored in RAM but not actively used will be shuffled into the swap file when another active process needs access to more physical memory, then returned when the original process runs again. –  Feb 26 '21 at 23:03
  • Not anything you can control directly. But when a process is suspended with Ctrl-Z (or otherwhise inactive) it's memory pages will be swapped / paged) out to swap-space. So having enough SWAP may be a help. – Soren A Feb 27 '21 at 00:01
  • @SorenA Well, i have 4 GB RAM, but when i first start MediathekView and then FlightGear, my PC will just freeze forever with full RAM, and only a reboot helps. Aren't 2 GB of SWAP enough ? – TheEagle Feb 27 '21 at 00:06
  • @Programmer If you run out of RAM and SWAP then 4 G RAM and 2 G SWAP isn't enough. Try to add more SWAP so you have same or 1,5 times RAM. But more RAM would be better / faster. – Soren A Feb 27 '21 at 00:26
  • You should ask about the actual problem that you have, not your proposed solution. This will avoid what is called the "XY problem". – Nmath Feb 27 '21 at 02:31
  • @Nmath you are right, i included the actual problem into my question. – TheEagle Feb 27 '21 at 10:15
  • What you want is exactly what the swapping system is designed to do. There are limits, however, and it is doubtfull that you would handle it better the manual way. Avoid using these programs simultaneously, or try increasing the swap space, or, best of all, just invest in more RAM. – vanadium Feb 27 '21 at 11:31
  • @vanadium can you recommend me a good tutorial on how to increase SWAP space ? I found multiple, all of them followed more or less the same steps, but only one of them said I should make a backup of my data before. That was confusing for me, and now I do not know what to do, – TheEagle Feb 27 '21 at 11:35
  • You can use swap files nowadays that are easily resized: https://askubuntu.com/questions/1075505/how-do-i-increase-swapfile-in-ubuntu-18-04/1075516?noredirect=1#comment2247788_1075516. Otherwise, you need to resize partitions. Do not expect people will repeated over and over again for you that you must always make sure that your personal data are safeguarded at any time. That is obvious, because these data are unique and cannot be restored when lost, in contrast to an operating system. If you do not have a good backup system, make one now before proceeding with anything else. – vanadium Feb 27 '21 at 11:43

0 Answers0