Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1180  / 1 Year ago, sat, january 14, 2023, 8:18:11

I experience from time to time when I'm working heavily, that my systems (Ubuntu 13.10) freezes. Syslog says, that a process had to be killed to to memory shortage.



Killed process 4693 (chromium-browse) total-vm:1386284kB, anon-rss:31688kB, file-rss:3424kB


That happens even if my swap is pretty much empty. I do have 4GB RAM and 4GB Swap partition.



Top says:



KiB Mem:   3932056 total,  2828880 used
KiB Swap: 4079612 total, 332492 used,


So plenty of room available. But then I found out, that some processes are not using swap at all. They seem to eat all my physical RAM without even considering swapping some pages to disk. I used "top"'s SWAP column to verify SWAP usage per process.



These are e.g. Chromium web browser and VirtualBox. Others, like Firefox, Netbeans, etc. are swapping.



So who "decides" what process is swapping and which not? From my understanding, this is done by the kernel, because from application perspective memory is memory without distinguishing between swap and physical RAM. Is that true or do the Chromium developer have the application set to only use physical RAM?



Thanks for your help!


More From » 13.10

 Answers
5

I think your "problem" is with VirtualBox.



According to the VirtualBox Manual




Base memory



This sets the amount of RAM that is allocated and given to the VM when it is running. The specified amount of memory will be requested from the host operating system, so it must be available or made available as free memory on the host when attempting to start the VM and will not be available to the host while the VM is running.




I found similar comments on the VirtualBox forums (although they were not as helpful).



See: https://forums.virtualbox.org/viewtopic.php?f=2&t=50179



So I am guessing the virtualbox kernel module allocates free memory to the guest but is not polite enough to inform the host. Thus when you look at free RAM (with tools such as free -m) you appear to have sufficient memory BUT ... because the kernel module does not inform the host OS, the host can not appropriately manage swap, and your applications then crash doe to a lack of memory (free or swap).



I would suggest you file a bug report, but, I am guessing it would be closed as "won't fix"



From the thread on the VirtualBox forums linked in Tim's comment:




To answer your question as to if VBox can or can not use swap, no, nothing but the operating system can do that. Swap is not memory that is actually usable.



[#26400] Saturday, January 14, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rryble

Total Points: 489
Total Questions: 121
Total Answers: 119

Location: Marshall Islands
Member since Mon, May 31, 2021
3 Years ago
rryble questions
Thu, Jan 5, 23, 18:10, 1 Year ago
Wed, Aug 11, 21, 07:19, 3 Years ago
Fri, Jul 23, 21, 00:13, 3 Years ago
;