23.8. 内存分配
如果客户机虚拟机崩溃,可选属性
dumpCore
可用于控制客户机虚拟机内存是否应该包含在生成的内核转储中(dumpCore='on'
)或未包括(dumpCore='off'
)。请注意,默认设置 在 上
,因此,除非将 参数设置为 off
,否则客户机虚拟机内存将包含在 core dumpfile 中。
<maxMemory>
元素决定客户机的最大运行时内存分配。插槽
属性指定可用于向客户机中添加内存的插槽数。
<memory>
元素指定在引导时为客户机分配的最大内存。这也可以使用 NUMA 单元大小配置来设置,也可以通过将内存热插到 maxMemory
指定的限制来增加。
<currentMemory>
元素决定客户机虚拟机的实际内存分配。这个值可能小于最大分配量(由 <内存>
设定),以根据需要允许客户机虚拟机内存到 balloon。如果省略,则默认为与 <memory>
元素相同的值。unit 属性的行为与内存相同。
图 23.10. 内存单元
<domain> <maxMemory slots='16' unit='KiB'>1524288</maxMemory> <memory unit='KiB' dumpCore='off'>524288</memory> <!-- changes the memory unit to KiB and does not allow the guest virtual machine's memory to be included in the generated core dumpfile --> <currentMemory unit='KiB'>524288</currentMemory> <!-- makes the current memory unit 524288 KiB --> ... </domain>