1. root@snic10e:/tmp# while true; do
  2. > echo "dnsmasq restart"
  3. > service dnsmasq restart
  4. > sleep 1
  5. > echo "before cache drop:"
  6. > free
  7. > sleep 1
  8. > echo 3 > /proc/sys/vm/drop_caches
  9. > sleep 1
  10. > echo "after cache drop:"
  11. > free
  12. > sleep 1
  13. > done
  14. dnsmasq restart
  15. before cache drop:
  16. total used free shared buff/cache available
  17. Mem: 1991508 87948 1883424 17488 20136 1860172
  18. Swap: 0 0 0
  19. [ 4129.167679] ash (634): drop_caches: 3
  20. after cache drop:
  21. total used free shared buff/cache available
  22. Mem: 1991508 88004 1883368 17488 20136 1860116
  23. Swap: 0 0 0
  24. dnsmasq restart
  25. before cache drop:
  26. total used free shared buff/cache available
  27. Mem: 1991508 88344 1882980 17488 20184 1859752
  28. Swap: 0 0 0
  29. [ 4133.589184] ash (634): drop_caches: 3
  30. after cache drop:
  31. total used free shared buff/cache available
  32. Mem: 1991508 88360 1882964 17488 20184 1859736
  33. Swap: 0 0 0
  34. dnsmasq restart
  35. before cache drop:
  36. total used free shared buff/cache available
  37. Mem: 1991508 89720 1881604 17488 20184 1858376
  38. Swap: 0 0 0
  39. [ 4138.010682] ash (634): drop_caches: 3
  40. after cache drop:
  41. total used free shared buff/cache available
  42. Mem: 1991508 89576 1881748 17488 20184 1858520
  43. Swap: 0 0 0
  44. dnsmasq restart
  45. before cache drop:
  46. total used free shared buff/cache available
  47. Mem: 1991508 89868 1881468 17480 20172 1858240
  48. Swap: 0 0 0
  49. [ 4142.434119] ash (634): drop_caches: 3
  50. after cache drop:
  51. total used free shared buff/cache available
  52. Mem: 1991508 89840 1881488 17488 20180 1858260
  53. Swap: 0 0 0
  54. dnsmasq restart
  55. ^C
  56. root@snic10e:/tmp#