NeuroAgent

Why Proxmox Doesn't Use All RAM: Complete Guide

Learn why Proxmox doesn't use all available RAM and how to optimize memory usage. Balloon driver diagnostics, system parameter configuration, and solutions for effective memory management in Proxmox VE.

Proxmox is not using all available RAM

Hello! I have a Proxmox 8.3.2 node with 2 CPUs (72 cores) and 128 GB of RAM. The disks are configured with LVM, not ZFS.

I’ve noticed that Proxmox is not using all available RAM. Over 99 GB of the 128 GB are never utilized, and the system starts actively using SWAP. This happens even after a server reboot. I understand that using SWAP is normal, but I’m concerned about the unused amount of RAM.

I experimented with the swappiness parameter, setting it to 10, 1, and 50, but the problem persists.

What could be causing this behavior? Is this normal system operation? It would be very helpful to have an additional 25 GB of RAM available.

Currently, 87064 MB is occupied by virtual machines. Somewhere the balloon mechanism is enabled, but the total memory usage does not exceed the available amount.

As a result, I had to reduce the memory allocation for virtual machines to prevent SWAP from loading at 100%.

What could be wrong with the system configuration?

NeuroAgent

Proxmox doesn’t use all available RAM due to built-in Linux memory management mechanisms that intentionally leave part of RAM free for buffers and cache to avoid aggressive allocation of all available memory. This is normal system behavior aimed at ensuring stability and performance, especially when working with virtual machines. The problem with active SWAP usage when RAM is unused is usually related to incorrect balloon driver configuration in virtual machines or host memory management parameters.

Contents

Main reasons for unused RAM

In Linux systems, including Proxmox, there are several reasons why all available RAM might not be used:

Linux buffer caching - the system intentionally allocates memory for file caches and buffers. This isn’t “lost” memory, but efficient resource utilization to speed up I/O operations. You can check this with the command:

bash
free -h

Pay attention to the “buff/cache” section - this memory is actively used by the system to improve performance.

ZFS ARC (if used) - when using the ZFS filesystem, there’s an Adaptive Replacement Cache that can occupy a significant amount of RAM. However, in your case, you mentioned using LVM, so this factor doesn’t apply.

Memory reservation for kernel and processes - Linux always keeps a certain amount of memory untouched for system processes and the kernel, especially on server systems with large amounts of RAM.

Balloon driver issues

Virtual machines in Proxmox can use a balloon driver for dynamic memory management. This is a common cause of the problems you’re describing:

How balloon driver works - ballooning allows VMs to “return” unused memory back to the host system. However, when misconfigured, this can lead to a paradoxical situation where the VM reports available memory while the host actively uses SWAP.

Problem symptoms:

  • High SWAP level with available RAM
  • Low overall memory usage on the host
  • Slow virtual machine performance

Checking balloon status:

bash
qm list  # to view VM list
qm config <VMID> | grep balloon  # check configuration of a specific VM

Proxmox memory settings configuration

To properly manage memory in Proxmox, you need to configure several parameters correctly:

Swappiness parameter - you’ve already tried changing this parameter, but it’s important to understand that it only affects the system’s decision to move memory pages to SWAP, not the overall memory allocation policy. Values of 10-50 are reasonable for server systems.

Memory overcommitment - in Proxmox, you can configure the ability to allocate more memory than is physically available:

bash
cat /etc/sysctl.conf | grep vm.swappiness
cat /etc/sysctl.conf | grep overcommit_memory

Check the value of vm.overcommit_memory. For servers, values of 2 (strict control) or 1 (soft control) are usually recommended.

Huge Pages - for systems with large amounts of RAM, enabling Huge Pages can improve performance:

bash
echo never > /sys/kernel/mm/transparent_hugepage/enabled

Diagnostics and monitoring

For accurate diagnosis of memory issues, use the following tools:

Free command with details:

bash
free -h
free -m

Pay attention to the ratio between used, free, buff/cache, and swap.

Vmstat utility:

bash
vmstat 1 10

The si (swap in) and so (swap out) parameters show swap activity.

Sar utility (sysstat):

bash
sar -r 1 10

Shows real-time memory usage.

/proc/meminfo:

bash
cat /proc/meminfo | grep -E "(MemAvailable|MemFree|Swap|Slab|PageTables)"

The MemAvailable parameter is particularly important - this is the memory actually available for allocation.

Optimization solutions

To solve the problem with unused RAM and active SWAP, you can take the following steps:

Disable balloon driver for virtual machines that don’t require dynamic memory management:

bash
qm set <VMID> -balloon 0

Configure sysctl parameters:

bash
cat >> /etc/sysctl.conf << EOF
vm.swappiness = 10
vm.vfs_cache_pressure = 50
EOF
sysctl -p

Optimize caching - reduce pressure on the filesystem cache:

bash
echo 50 > /proc/sys/vm/vfs_cache_pressure

Monitor specific processes:

bash
ps aux --sort=-%mem | head -10

Allows you to see which processes are consuming the most memory.

Virtual machine configuration checking

It’s important to check the settings of each virtual machine for incorrect memory usage:

VM configuration check:

bash
qm config <VMID>

Pay attention to the parameters:

  • memory - allocated memory
  • balloon - is balloon enabled
  • shares - memory priority
  • limit - memory limit

Check memory usage within VM:
For each virtual machine, check the actual memory usage:

bash
qm guest exec <VMID> "free -h"

Analyze Proxmox logs:

bash
journalctl -u pve-cluster -f
journalctl -u corosync -f

May contain errors related to memory management.

Sources

  1. Proxmox VE Memory Management Documentation
  2. Linux Memory Management Explained
  3. Balloon Driver in Virtualization
  4. Linux Memory Management Best Practices
  5. Proxmox Performance Tuning Guide

Conclusion

Unused RAM in Proxmox is in most cases normal system behavior aimed at ensuring stability and performance. Key points:

  1. Buffer caching - a significant portion of “unused” memory is actually occupied by Linux file caches and buffers, which is efficient resource utilization.

  2. Balloon driver - it’s most often the cause of problems with active SWAP usage when RAM is available. Check and disable it for non-critical virtual machines.

  3. Proper configuration - optimal parameters swappiness=10 and vfs_cache_pressure=50 will help balance memory usage.

  4. Monitoring - regularly use free, vmstat, and sar to monitor memory status.

  5. VM configuration - check the settings of each virtual machine, especially allocated memory parameters and balloon driver.

For your case with 128GB RAM and active SWAP usage, it’s recommended to disable the balloon driver for most virtual machines and carefully configure memory management parameters in the system. This will allow for efficient use of available resources and avoid swapping issues.