Examples: Resizing DRAM Tier for KVM
Following are some examples of resizing DRAM tier and switching HugePages on and off. You can follow the examples using a VM on your own system by typing the commands shown.
Enable the DRAM Tier
The VM is started using the following application configuration file:
DpmeSocketName: /tmp/dpme_daemon.0
MmapCapture: true
MallocCapture: true
LogName: /var/log/memverge/kvm.log
CommPort: 5678
EnableSnapshot: false
DramTierGB: 0
HugePageDram: false
The DRAM tier is disabled, as specified in the file:
# mvmcli show-usage -v -p 47946 This instance is using 36.73 MiB DRAM, 1594.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots DRAM Tier is not enabled. #
Resize the DRAM tier to 2 GB with HugePages:
# mvmcli dram resize -s 2048 -p 47946 -g true DRAM tier is resized to 2048 MB using huge page on process 47946 # mvmcli show-usage -v -p 47946 This instance is using 36.73 MiB DRAM, 1660.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 2048.00 Allocated DRAM size (MiB): 256.00 Mapped DRAM size (MiB) : 0.00 Use HugePages: Yes #
Disable the DRAM Tier
The VM starts with DRAM tier set to 4 GB and HugePages on:
# mvmcli show-usage -v -p 47946 This instance is using 1628.68 MiB DRAM, 0.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 4096.00 Allocated DRAM size (MiB): 1792.00 Mapped DRAM size (MiB) : 1592.00 Use HugePages: Yes #
Disable the DRAM tier:
# mvmcli dram resize -s 0 -p 47946 DRAM tier is disabled on process 47946 # mvmcli show-usage -v -p 47946 This instance is using 36.73 MiB DRAM, 1594.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots DRAM Tier is not enabled. #
Expand the DRAM Tier
The VM starts with DRAM set to 4 GB with HugePages on. All DRAM tier is in use (mapped DRAM size is 4096):
# mvmcli show-usage -v -p 41076 This instance is using 4133.02 MiB DRAM, 492.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 4096.00 Allocated DRAM size (MiB): 4096.00 Mapped DRAM size (MiB) : 4096.00 Use HugePages: Yes #
Resize the DRAM tier to 8 GB:
# mvmcli dram resize -s 8192 -p 41076 DRAM tier is resized to 8192 MB using huge page on process 41076 # mvmcli show-usage -v -p 41076 This instance is using 8229.02 MiB DRAM, 1408.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 8192.00 Allocated DRAM size (MiB): 8192.00 Mapped DRAM size (MiB) : 8192.00 Use HugePages: Yes #
Shrink the DRAM Tier
The VM starts with DRAM set to 8GB with HugePages on:
# mvmcli show-usage -v -p 49503 This instance is using 7592.94 MiB DRAM, 0.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 8192.00 DRAM tier is 8G Allocated DRAM size (MiB): 7680.00 Mapped DRAM size (MiB) : 7554.00 Use HugePages: Yes #
Resize the DRAM tier to 4 GB:
# mvmcli dram resize -s 4096 -p 49503 DRAM tier is resized to 4096 MB using huge page on process 49503 # mvmcli show-usage -v -p 49503 This instance is using 4136.96 MiB DRAM, 3466.00 MiB PMEM for current execution and 0.00 MiB PMEM for snapshots Configured DRAM iter size (MiB): 4096.00 DRAM tier is to 4G, some memory goes to PMEM Allocated DRAM size (MiB): 4096.00 Mapped DRAM size (MiB) : 4096.00 Use HugePages: Yes #
The DRAM tier is reduced to 4 GB. HugePages are still in use.