Why the swap is not helping?

Before I explain the problem I’m facing, I would like to say that my claim is not that my swap is configured incorrectly (or maybe it is I don’t know!). It’s just that it’s not helping.

I’m working on some memory intensive tasks. I have a decent home computer but no matter how much memory you have, there will always be tasks that need more. That’s why when I was installing Manjaro, I’ve setup a swap partition. BTW, I wish we had the option to select the size of this partition then. But that’s a different story.

Anyways, my question is that, are there some type of memory alloaction request that a program can issue and it cannot be responded by swap? I’m asking this since the program that I’m running crashes and exits as soon as my physical memory exhausts. Without ever touching the swap. As if the swap is not good enough for it and it can only make use of physical memory.

Is there anything I can do to make use of swap in such cases?

There is a manual partitioning option in the installer.

1 Like

Hi @mehran,

You could always, and maybe should, try adapting the swappiness value so that it starts swapping earlier. See:

https://wiki.archlinux.org/title/Swap#Swappiness

1 Like

Thanks, @Mirdarthos . I didn’t know about swappiness. I still need to read more. But so far, based on what I read, it seems to me that swappiness only helps with the performance. I’m not sure if it actually helps with my case. Does it?

Perhaps, I should ask this question: Can swap help when a single program is asking for more memory than physically available on a computer?

Thanks, @ben75 . You are absolutely right. But my suggestion is to let the user select the size of swap in the auto mode. I might not have enough expertise to setup my partitions from ground-up but I can understand swap size. Anyways, it’s just a sugegstion.

I’m don’t know if it will, but my logic says it should. And besides, there’s only one way to know for certain…

Think the other way around: A program says how much RAM it can or will use at most → Virtual memory. If more is used, then the program may also crash. If you start a program that could address 10GB of RAM and you have 32GB of RAM, nothing will be swapped out to swap, but it will crash.

No. SWAP is not “additional RAM”, if a program needs more RAM than you have, it will crash. See the SWAP as a temporary parking for parts of the RAM.

2 Likes

Is there any other way to extend my physical memory using hard drive? Do I have any options?

4 Likes

Thanks for the link. It’s really practical. And it’s free too!! It’s just that it only has up to 32 GB which is not enough. Perhaps I should download it mutiple times. I just wish they had provided larges capacities. But again, it’s free.

Yeah, I mean you can’t really complain.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.