Debian VM RAM Assigned As SWAP

mikerohan

Member
Jan 31, 2019
14
0
6
35
I have created a Debian 10 or 11 vm and added 6GB of RAM but, this is allocated as swap inside the vm, have i dun something wrong.
I have tried other OS both, Linux and windows and this seems to be only happening with Debian, i have tried with and without ballooning enabled and changing the total amount of ram.

1620134895400.png

1620134927800.png
1620135080100.png
 
Last edited:
How do you know it's assigned as swap?
Swap usually is NOT in RAM, but part of the disk.

What is the output of free -h inside the VM?
 
Oh, sorry. You're right, I didn't recognize it.
How long was that VM running when you entered the command? I regularly see that RAM changes become only slowly visible to the guest.
And for the swap: I still doubt that this has to do with the RAM assignment. Does swap also change when you change the RAM?
 
How long was that VM running when you entered the command? I regularly see that RAM changes become only slowly visible to the guest.
A couple of hours but, i can leave it running and check periodically.


And for the swap: I still doubt that this has to do with the RAM assignment. Does swap also change when you change the RAM?

No, for some reason it seams to be stuck on 6Gb swap and 1 GB ram.
 
It's more like a matter of seconds, so this should have settled already.

For the swap, could you provide the output of fdisk -l /dev/sdX from inside the VM, replacing X with the respective device name?
 
For the swap, could you provide the output of fdisk -l /dev/sdX from inside the VM, replacing X with the respective device name?

Is this the disk you were referring to.
1620142330800.png

You are wrong. Your screenshot have different columns, it say that you have 6 G swap and 0 G in use!

I was referring to the total amount, from what i have seen so far thats fixed.
 
Hi again,

I see now what you say (my screen iis small). I guess that When you create the VM you have define 6 G Ram and 6 G swap, but when you start the VM, at runtime, your PMX host have only 1 G ram free and not 6. So it allocate 1 G ram for VM.
 
I see now what you say (my screen iis small). I guess that When you create the VM you have define 6 G Ram and 6 G swap, but when you start the VM, at runtime, your PMX host have only 1 G ram free and not 6. So it allocate 1 G ram for VM.

The host has plenty of ram and this only seems to be happening with debian.
 
I have a lot of Debian machines and didn't encounter that behavior so far ... ;)
What is the layout of the LVM (lvdisplay)? I still think that there is a 6 GB swap partition ... Doesn't explain the RAM mismatch, though.
 
Well, this explains the 6 GB of Swap at least. :)
Probably the installer chose this size, maybe because of the assigned RAM.
 
It's surprising that its not dynamic, as it seams to be on other os, will i have to adjust it every time i change the ram.
 
Just to be sure, did you reset the machine after you changed the RAM size? Or is the amount of RAM printed in orange on the hardware page of the VM?
 
Yes, i have either stopped the vm before adding ram or stopped then started it up again also, i have hot swap ram on.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!