Does Ubuntu swap even when there is no swap configured?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












In my /etc/fstab there is no swap partition.



top displays KiB Swap: 0 total, 0 free, 0 used



and swapon shows nothing.



So it looks like swap is disabled. But when the system runs out of physical memory, it starts behaving like it's swapping: the system becomes nearly unresponsive, disc access indicator is on all the time; if I manage to close a heavy process (or if it gets killed, probably by an Out-of-Memory killer), the system becomes responsive again.



Does Ubuntu still swap in such a case?



The system is Ubuntu 16.04.










share|improve this question



















  • 1




    What does swapon show? No output means no swap is configured.
    – PerlDuck
    Apr 13 at 18:48






  • 2




    "like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
    – Rinzwind
    Apr 13 at 18:49






  • 2




    +1, the system runs out of RAM.
    – mikewhatever
    Apr 13 at 19:23










  • @PerlDuck swapon shows nothing
    – Roman Puchkovskiy
    Apr 13 at 19:52










  • @mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
    – Roman Puchkovskiy
    Apr 13 at 19:59














up vote
1
down vote

favorite












In my /etc/fstab there is no swap partition.



top displays KiB Swap: 0 total, 0 free, 0 used



and swapon shows nothing.



So it looks like swap is disabled. But when the system runs out of physical memory, it starts behaving like it's swapping: the system becomes nearly unresponsive, disc access indicator is on all the time; if I manage to close a heavy process (or if it gets killed, probably by an Out-of-Memory killer), the system becomes responsive again.



Does Ubuntu still swap in such a case?



The system is Ubuntu 16.04.










share|improve this question



















  • 1




    What does swapon show? No output means no swap is configured.
    – PerlDuck
    Apr 13 at 18:48






  • 2




    "like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
    – Rinzwind
    Apr 13 at 18:49






  • 2




    +1, the system runs out of RAM.
    – mikewhatever
    Apr 13 at 19:23










  • @PerlDuck swapon shows nothing
    – Roman Puchkovskiy
    Apr 13 at 19:52










  • @mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
    – Roman Puchkovskiy
    Apr 13 at 19:59












up vote
1
down vote

favorite









up vote
1
down vote

favorite











In my /etc/fstab there is no swap partition.



top displays KiB Swap: 0 total, 0 free, 0 used



and swapon shows nothing.



So it looks like swap is disabled. But when the system runs out of physical memory, it starts behaving like it's swapping: the system becomes nearly unresponsive, disc access indicator is on all the time; if I manage to close a heavy process (or if it gets killed, probably by an Out-of-Memory killer), the system becomes responsive again.



Does Ubuntu still swap in such a case?



The system is Ubuntu 16.04.










share|improve this question















In my /etc/fstab there is no swap partition.



top displays KiB Swap: 0 total, 0 free, 0 used



and swapon shows nothing.



So it looks like swap is disabled. But when the system runs out of physical memory, it starts behaving like it's swapping: the system becomes nearly unresponsive, disc access indicator is on all the time; if I manage to close a heavy process (or if it gets killed, probably by an Out-of-Memory killer), the system becomes responsive again.



Does Ubuntu still swap in such a case?



The system is Ubuntu 16.04.







swap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 16 at 8:57









Zanna

48k13119228




48k13119228










asked Apr 13 at 18:44









Roman Puchkovskiy

1195




1195







  • 1




    What does swapon show? No output means no swap is configured.
    – PerlDuck
    Apr 13 at 18:48






  • 2




    "like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
    – Rinzwind
    Apr 13 at 18:49






  • 2




    +1, the system runs out of RAM.
    – mikewhatever
    Apr 13 at 19:23










  • @PerlDuck swapon shows nothing
    – Roman Puchkovskiy
    Apr 13 at 19:52










  • @mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
    – Roman Puchkovskiy
    Apr 13 at 19:59












  • 1




    What does swapon show? No output means no swap is configured.
    – PerlDuck
    Apr 13 at 18:48






  • 2




    "like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
    – Rinzwind
    Apr 13 at 18:49






  • 2




    +1, the system runs out of RAM.
    – mikewhatever
    Apr 13 at 19:23










  • @PerlDuck swapon shows nothing
    – Roman Puchkovskiy
    Apr 13 at 19:52










  • @mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
    – Roman Puchkovskiy
    Apr 13 at 19:59







1




1




What does swapon show? No output means no swap is configured.
– PerlDuck
Apr 13 at 18:48




What does swapon show? No output means no swap is configured.
– PerlDuck
Apr 13 at 18:48




2




2




"like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
– Rinzwind
Apr 13 at 18:49




"like it's swapping: the system becomes nearly unresponsive" sorry how is that "like swapping". That's your system running with not enough memory to do what needs to be done. "Swap" would mean it drops memory into swap where it decides it has not been used for a while and it is deemed more efficient to clear some memory for new tasks.
– Rinzwind
Apr 13 at 18:49




2




2




+1, the system runs out of RAM.
– mikewhatever
Apr 13 at 19:23




+1, the system runs out of RAM.
– mikewhatever
Apr 13 at 19:23












@PerlDuck swapon shows nothing
– Roman Puchkovskiy
Apr 13 at 19:52




@PerlDuck swapon shows nothing
– Roman Puchkovskiy
Apr 13 at 19:52












@mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
– Roman Puchkovskiy
Apr 13 at 19:59




@mikewhatever I'm probably misunderstanding something. When a system runs out of RAM, shouldn't it result in OOM killer killing a process, or some process crashing due to an unsuccessful attempt to allocate memory? Both of these would bring relief, but this does not happen every time. I do have some JVMs that may put all their CPU resources in garbage collection, but it should not freeze the system, I guess. Once again, I am probably misunderstanding something; could you please elaborate?
– Roman Puchkovskiy
Apr 13 at 19:59










1 Answer
1






active

oldest

votes

















up vote
8
down vote



accepted










The short answer:



If there is no swap, Ubuntu will not swap.



The long answer:



What happens is that the Linux kernel memory manager (not really Ubuntu itself) will first try to consolidate memory into chunks it can allocate to the applications requesting said memory (the slowdown you're seeing) and if it cannot, these applications will crash, thus freeing up their memory for the more well-behaved applications that did not crash.



The Kernel's OOM Killer¹ is only invoked if and only if there is no other way of doing so² and looking at your high disk usage, you're running into the too small to fail memory allocation rule. The relevant section states:




In other words, the allocating process cannot proceed because it is waiting for its allocation call to return. That call cannot return until memory is freed, which requires the victim process to exit. The OOM killer will also wait for the victim to exit before (possibly) choosing a second process to kill.




The rant:



Back when I was a kid and the only qualification you needed to start in the IT industry was the ability to read manuals and 32K was the norm and 64K was "wow", we used to check every memory allocation and display "Out of memory" when we couldn't allocate memory at an application level, which today's kids programmers don't do any more as they're spoilt rotten with multiple monitors, huge SSDs and systems that are generally better than the systems their software actually runs on they are not used to having systems run out of memory any more...



;-)






share|improve this answer


















  • 1




    +1 for the details in the long answer and the rant :-)
    – sudodus
    Apr 14 at 5:03










  • Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
    – Roman Puchkovskiy
    Apr 14 at 10:26






  • 1




    Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
    – Byte Commander
    Apr 14 at 19:21










  • RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
    – Fabby
    Apr 20 at 6:53











  • @Fabby that was interesting, thank you :)
    – Roman Puchkovskiy
    Apr 26 at 17:26










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1024755%2fdoes-ubuntu-swap-even-when-there-is-no-swap-configured%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
8
down vote



accepted










The short answer:



If there is no swap, Ubuntu will not swap.



The long answer:



What happens is that the Linux kernel memory manager (not really Ubuntu itself) will first try to consolidate memory into chunks it can allocate to the applications requesting said memory (the slowdown you're seeing) and if it cannot, these applications will crash, thus freeing up their memory for the more well-behaved applications that did not crash.



The Kernel's OOM Killer¹ is only invoked if and only if there is no other way of doing so² and looking at your high disk usage, you're running into the too small to fail memory allocation rule. The relevant section states:




In other words, the allocating process cannot proceed because it is waiting for its allocation call to return. That call cannot return until memory is freed, which requires the victim process to exit. The OOM killer will also wait for the victim to exit before (possibly) choosing a second process to kill.




The rant:



Back when I was a kid and the only qualification you needed to start in the IT industry was the ability to read manuals and 32K was the norm and 64K was "wow", we used to check every memory allocation and display "Out of memory" when we couldn't allocate memory at an application level, which today's kids programmers don't do any more as they're spoilt rotten with multiple monitors, huge SSDs and systems that are generally better than the systems their software actually runs on they are not used to having systems run out of memory any more...



;-)






share|improve this answer


















  • 1




    +1 for the details in the long answer and the rant :-)
    – sudodus
    Apr 14 at 5:03










  • Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
    – Roman Puchkovskiy
    Apr 14 at 10:26






  • 1




    Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
    – Byte Commander
    Apr 14 at 19:21










  • RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
    – Fabby
    Apr 20 at 6:53











  • @Fabby that was interesting, thank you :)
    – Roman Puchkovskiy
    Apr 26 at 17:26














up vote
8
down vote



accepted










The short answer:



If there is no swap, Ubuntu will not swap.



The long answer:



What happens is that the Linux kernel memory manager (not really Ubuntu itself) will first try to consolidate memory into chunks it can allocate to the applications requesting said memory (the slowdown you're seeing) and if it cannot, these applications will crash, thus freeing up their memory for the more well-behaved applications that did not crash.



The Kernel's OOM Killer¹ is only invoked if and only if there is no other way of doing so² and looking at your high disk usage, you're running into the too small to fail memory allocation rule. The relevant section states:




In other words, the allocating process cannot proceed because it is waiting for its allocation call to return. That call cannot return until memory is freed, which requires the victim process to exit. The OOM killer will also wait for the victim to exit before (possibly) choosing a second process to kill.




The rant:



Back when I was a kid and the only qualification you needed to start in the IT industry was the ability to read manuals and 32K was the norm and 64K was "wow", we used to check every memory allocation and display "Out of memory" when we couldn't allocate memory at an application level, which today's kids programmers don't do any more as they're spoilt rotten with multiple monitors, huge SSDs and systems that are generally better than the systems their software actually runs on they are not used to having systems run out of memory any more...



;-)






share|improve this answer


















  • 1




    +1 for the details in the long answer and the rant :-)
    – sudodus
    Apr 14 at 5:03










  • Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
    – Roman Puchkovskiy
    Apr 14 at 10:26






  • 1




    Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
    – Byte Commander
    Apr 14 at 19:21










  • RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
    – Fabby
    Apr 20 at 6:53











  • @Fabby that was interesting, thank you :)
    – Roman Puchkovskiy
    Apr 26 at 17:26












up vote
8
down vote



accepted







up vote
8
down vote



accepted






The short answer:



If there is no swap, Ubuntu will not swap.



The long answer:



What happens is that the Linux kernel memory manager (not really Ubuntu itself) will first try to consolidate memory into chunks it can allocate to the applications requesting said memory (the slowdown you're seeing) and if it cannot, these applications will crash, thus freeing up their memory for the more well-behaved applications that did not crash.



The Kernel's OOM Killer¹ is only invoked if and only if there is no other way of doing so² and looking at your high disk usage, you're running into the too small to fail memory allocation rule. The relevant section states:




In other words, the allocating process cannot proceed because it is waiting for its allocation call to return. That call cannot return until memory is freed, which requires the victim process to exit. The OOM killer will also wait for the victim to exit before (possibly) choosing a second process to kill.




The rant:



Back when I was a kid and the only qualification you needed to start in the IT industry was the ability to read manuals and 32K was the norm and 64K was "wow", we used to check every memory allocation and display "Out of memory" when we couldn't allocate memory at an application level, which today's kids programmers don't do any more as they're spoilt rotten with multiple monitors, huge SSDs and systems that are generally better than the systems their software actually runs on they are not used to having systems run out of memory any more...



;-)






share|improve this answer














The short answer:



If there is no swap, Ubuntu will not swap.



The long answer:



What happens is that the Linux kernel memory manager (not really Ubuntu itself) will first try to consolidate memory into chunks it can allocate to the applications requesting said memory (the slowdown you're seeing) and if it cannot, these applications will crash, thus freeing up their memory for the more well-behaved applications that did not crash.



The Kernel's OOM Killer¹ is only invoked if and only if there is no other way of doing so² and looking at your high disk usage, you're running into the too small to fail memory allocation rule. The relevant section states:




In other words, the allocating process cannot proceed because it is waiting for its allocation call to return. That call cannot return until memory is freed, which requires the victim process to exit. The OOM killer will also wait for the victim to exit before (possibly) choosing a second process to kill.




The rant:



Back when I was a kid and the only qualification you needed to start in the IT industry was the ability to read manuals and 32K was the norm and 64K was "wow", we used to check every memory allocation and display "Out of memory" when we couldn't allocate memory at an application level, which today's kids programmers don't do any more as they're spoilt rotten with multiple monitors, huge SSDs and systems that are generally better than the systems their software actually runs on they are not used to having systems run out of memory any more...



;-)







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 20 at 6:47

























answered Apr 13 at 23:43









Fabby

24.3k1352153




24.3k1352153







  • 1




    +1 for the details in the long answer and the rant :-)
    – sudodus
    Apr 14 at 5:03










  • Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
    – Roman Puchkovskiy
    Apr 14 at 10:26






  • 1




    Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
    – Byte Commander
    Apr 14 at 19:21










  • RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
    – Fabby
    Apr 20 at 6:53











  • @Fabby that was interesting, thank you :)
    – Roman Puchkovskiy
    Apr 26 at 17:26












  • 1




    +1 for the details in the long answer and the rant :-)
    – sudodus
    Apr 14 at 5:03










  • Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
    – Roman Puchkovskiy
    Apr 14 at 10:26






  • 1




    Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
    – Byte Commander
    Apr 14 at 19:21










  • RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
    – Fabby
    Apr 20 at 6:53











  • @Fabby that was interesting, thank you :)
    – Roman Puchkovskiy
    Apr 26 at 17:26







1




1




+1 for the details in the long answer and the rant :-)
– sudodus
Apr 14 at 5:03




+1 for the details in the long answer and the rant :-)
– sudodus
Apr 14 at 5:03












Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
– Roman Puchkovskiy
Apr 14 at 10:26




Thank you for the point about memory compaction. The ever-shining disk access LED still remains a mystery for me, but I guess I have to create another question about it :)
– Roman Puchkovskiy
Apr 14 at 10:26




1




1




Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
– Byte Commander
Apr 14 at 19:21




Why do you claim OOM Killers don't exist? en.wikipedia.org/wiki/Out_of_memory / unix.stackexchange.com/q/136291/103151 / unix.stackexchange.com/q/153585/103151
– Byte Commander
Apr 14 at 19:21












RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
– Fabby
Apr 20 at 6:53





RomanPuchkovskiy Disk light is very probably the invocation of the OOM killer (which doesn't get invoked often, so resides on disk). after reading @ByteCommander 's docs. Mystery solved!
– Fabby
Apr 20 at 6:53













@Fabby that was interesting, thank you :)
– Roman Puchkovskiy
Apr 26 at 17:26




@Fabby that was interesting, thank you :)
– Roman Puchkovskiy
Apr 26 at 17:26

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1024755%2fdoes-ubuntu-swap-even-when-there-is-no-swap-configured%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491