[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] reported memory usage does not match real memory usage
Am Wed, 12 Feb 2020 11:53:25 +0100 schrieb Olaf Hering <olaf@xxxxxxxxx>: > Is there a formula to calculate that amount of extra memory, is this behavior > documented somewhere? With the script below, the formula may look like this: - each vcpu needs 1MB extra memory - each GB of a HVM domU memory needs 8MB extra memory - each HVM domU needs 2MB extra memory I assume these 8MB per GB is needed for the EPT page tables. In case this extra memory is indeed some obvious static value, it would be better to allocate it from the value specified in 'memory=' to make sure a domU uses (almost) exactly the value that was configured. Olaf domU='hvm' free_memory='125551' for memory in {1024..102400} do test "$(( ${memory} % (4*1024) ))" = "0" || continue xl destroy "${domU}" &> /dev/null while test "`xl info | awk '/^free_memory/{print $3}'`" -lt "${free_memory}" do sleep 0.2 done xl create -q -f '/netshare/domU.cfg' "name='${domU}'" "memory='${memory}'" "vcpus='1'" while sleep 0.1 do state="`xl list "${domU}" | awk "/^"${domU}'/{print $5}'`" case "${state}" in r?????) break ;; ?b????) break ;; *) ;; esac done actual_free_memory="`xl info | awk '/^free_memory/{print $3}'`" domU_used_memory="$(( ${free_memory} - ${actual_free_memory} ))" extra_memory="$(( ${domU_used_memory} - ${memory} ))" echo "${memory}/$((${memory}/1024)) ${domU_used_memory} ${extra_memory}: $((((${memory}/1024)*8)+2))" done Attachment:
pgpY7GJHGGNFU.pgp _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |