-1

My PC - I am using Ubuntu 20.04 on my old potato pc to get it working. It has 2GB of RAM and an Intel i5 processor. I know it is really old, but I want to get this working.

Problem in detail- I only have 2 GB of RAM on my pc, so I was not able to do much on it. I found a solution in using a swap file. I have a 2TB hard drive and only 4GB were used, so I made a 1TB swap partition. I know this is kind of funny. Now I don't know if it's even working or not, because every time I check memory it's nearly 1700MB used.

Actual problem - I want to ask some questions,

  1. Is it actually going to be 1TB RAM?

  2. Will it harm my computer?

  3. Will it make it slow?

  4. Should I do something?

  5. What is an reasonable size to give to a swap partition?

What I read on the internet - I read that we should give half of RAM to swap file, or double the RAM. But that was not enough for me.

Any thoughts would be appreciated

Anyways thanks for your precious time

1
  • The problem that may arise that, if you has a large swap and some program wants to use too much memory, kernel will allocate it and the system will start thrashing, fell in a dilemma in using RAM and swap. But if you don't have such space, kernel will initiate OOM killer. Oct 10, 2021 at 16:47

1 Answer 1

2
  1. You will get 1TB of virtual memory. Then if processes need 1TB, they will work

  2. It will not harm

  3. I don’t think it will slow your system much if you don’t use the swap, but if you start using the swap, obviously your swapped processes will start to be slow. However, managing the swap (keeping track of free blocks…) will surely use some memory… then I wouldn’t use far too much swap compared with my usages.

  4. I don’t get the question !

  5. There are no ideal size for a swap partition. If you put too less (depending of your applications), the kernel will refuse to allocate memory for processes which need some. If you need a lot of swap compared to the memory, it is probably a sign that you need to upgrade your memory (or your system if it is full of RAM). This is why having swap at a close magnitude to the RAM seems a good start. Then the ideal depends of your needs. For example if I upgrade my system to a 16GB, I won’t need swap and swap may harm some applications (real-time music synthesis). My ideal swap would be 0 !

Not the answer you're looking for? Browse other questions tagged .