Skip to content

KVM host Available memory calculation is incorrect #5523

Closed

Description

@div8cn
ISSUE TYPE
  • Bug Report
COMPONENT NAME
AGENT
CLOUDSTACK VERSION
4.15.0.0
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

Defined in the current code
Available memory = free memory + cache memory (Is Buffers memory missing here)

https://github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/MemStat.java#L58

/proc/meminfo in the linux kernel has already calculated the Available memory for us, why not use it directly?

The memory occupied by Buffers will be automatically released when we need it;

If we don't calculate Buffers in Available memory, it often happens that the host allocates a small amount of memory, but the CLOUDSTACK shows that the host has run out of memory (because the memory is occupied by Buffers). As a result, we cannot run more instances in the host

image

image

STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions