Last active
December 15, 2019 03:11
-
-
Save iAklis/ea544a147f2d3a75ebce3ddf05b03b3e to your computer and use it in GitHub Desktop.
Revisions
-
iAklis revised this gist
Dec 14, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ prefix=/sys/fs/cgroup/memory/aklis for i in {1..1000}; do mkdir $prefix-$i; bash -c "echo \$\$ > $prefix-$i/tasks; mkdir /tmp/$i; echo 'fubao'>/tmp/$i/pandada8;" done created_memcg_num=$(cat /proc/cgroups | awk '/memory/ {print $3}') -
iAklis created this gist
Dec 14, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/bash old_memcg_num=$(cat /proc/cgroups | awk '/memory/ {print $3}') free -m slabtop -o | head echo "now the number of memory cgroup is $old_memcg_num" echo "begin to create cgroups" prefix=/sys/fs/cgroup/memory/aklis for i in {1..1000}; do mkdir $prefix-$i; bash -c "echo \$\$ > $prefix-$i/tasks; rm -rfv /tmp/$i; mkdir /tmp/$i; echo 'fubao'>/tmp/$i/pandada8;" done created_memcg_num=$(cat /proc/cgroups | awk '/memory/ {print $3}') free -m slabtop -o | head echo "now the number of memory cgroup is $created_memcg_num" echo "begin to del cgroups that created by Poc, pddka!" for i in {1..1000}; do rmdir $prefix-$i; done free -m slabtop -o | head deleted_memcg_num=$(cat /proc/cgroups | awk '/memory/ {print $3}') echo "now the number of memory cgroup is $deleted_memcg_num" echo "P.S. remember to clear the tmp file (/tmp)"