We have a testbed for an OSv project that runs (5.15.0-72-generic - 20.04.1-Ubuntu - x86_64) the same instances a lot of time. The script for the execution of a single run is very simple and follows:
while [ $x -le $t ]
do
./scripts/capstan_run.sh "$delay"
now="$(date +'%d%m%Y-%H%M%S')"
./scripts/stats.sh > stats/"$x"_"$delay"_stats_"$now".txt & PID=$!
sleep "$delay" #sleep delay mills for the execution
kill $PID ; wait $PID 2>/dev/null
echo "Delay $delay before fetches"
sleep "$delay" #sleep delay mills before fetch files
./scripts/fetch_files.sh "$delay"
./scripts/shutdown_vm.sh
((x++))
done
capstun_run.sh
initiates the simulation with containers executing on the QEMU virtualization layer. It then sleeps and retrieves files from the instances. The shutdown.sh
script terminates QEMU:
killall qemu-system-x86_64
We observe between runs an increment of used memory. It is constant and never decreases. The server has 126G of RAM and 24 CPUs.
For example we observe that used memory starts from 8% and arrives at 12%, with an increment of 0.1%.
Date Memory Disk CPU
...
07/04/2023-163242 12.03% 27% 15.00%
07/04/2023-163247 12.03% 27% 16.00%
07/04/2023-163252 12.03% 27% 16.00%
07/04/2023-163257 12.03% 27% 16.00%
07/04/2023-163303 12.03% 27% 16.00%
07/04/2023-163308 12.04% 27% 16.00%
07/04/2023-163313 12.03% 27% 16.00%
07/04/2023-163318 12.04% 27% 15.00%
07/04/2023-163323 12.04% 27% 16.00%
07/04/2023-163328 12.04% 27% 16.00%
07/04/2023-163334 12.04% 27% 16.00%
07/04/2023-163339 12.04% 27% 16.00%
07/04/2023-163344 12.06% 27% 16.00%
07/04/2023-163349 12.08% 27% 16.00%
07/04/2023-163354 12.09% 27% 16.00%
07/04/2023-163359 12.09% 27% 15.00%
07/04/2023-163405 12.09% 27% 15.00%
07/04/2023-163410 12.09% 27% 15.00%
07/04/2023-163415 12.09% 27% 15.00%
Is there any memory leak in QEMU?
=== UPDATE ===
The stats.sh computes the used % mem in this manner:
free -m | awk 'NR==2{printf "%.2f%%\t\t", $3*100/$2 }
So I think there is an error, because it's the "used/total*100" e does not include the cache.
Is my evaluation correct?