Debian VM RAM Assigned As SWAP

mikerohan

Member
Jan 31, 2019
14
0
6
32
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:

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
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?
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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?

it should be in the screenshots above, is it not visible?
 

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
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?
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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.
 

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
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?
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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.
 

guletz

Famous Member
Apr 19, 2017
1,458
226
83
Brasov, Romania
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.
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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.
 

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
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.
 

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
Well, this explains the 6 GB of Swap at least. :)
Probably the installer chose this size, maybe because of the assigned RAM.
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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.
 

ph0x

Active Member
Jul 5, 2020
749
128
43
/dev/null
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?
 

mikerohan

Member
Jan 31, 2019
14
0
6
32
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 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 your own in 60 seconds.

Buy now!