Re:In C, how do you know if the dynamic allocation succeeded?
by Hendrikto on Saturday November 06, 2021 @05:51AM
(#29128865)
> You as swap not because you need to actually use it […] In normal circumstances, swap should never really be utilised.
Swap is actually there so anonymous pages can be evicted, and is often used long before there is memory contention, during normal operation.
Not having swap means that only file-backed pages can be evicted. During memory contention, this can cause thrashing. During "normal" operation, it degrades performance.
Swap only being used when memory runs out, as kind of "emergency RAM", is a very widespread misunderstanding.
Re:In C, how do you know if the dynamic allocation succeeded?
by vbezhenar on Saturday November 06, 2021 @05:47AM
(#29128844)
> In normal circumstances, swap should never really be utilised.
I don't agree. There're plenty of dormant virtual memory pages which will never be used. Keeping them in RAM is wasting precious resources.
You as swap not because you need to actually use it, but on order to be able to guarantee there is enough memory available if the worst case scenario happens. In normal circumstances, swap should never really be utilised.