Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
2d3333dd
Commit
2d3333dd
authored
Sep 26, 2016
by
Rohit Gupta
Browse files
Gitlab CI: fix for cleaning memory only when critically low
parent
3124cb2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
cmake_targets/autotests/tools/free_mem.bash
View file @
2d3333dd
...
...
@@ -31,6 +31,26 @@
# \author Navid Nikaein, Rohit Gupta
# To free unused memory else test setup runs out of memory
sudo
-E
bash
-c
'echo 3 > /proc/sys/vm/drop_caches '
mem_threshold
=
0.2
#If free memory is less than this threshold, then VM drop cache is called
mem_tot
=
`
vmstat
-s
-S
k |grep
"total memory"
|
awk
'{print $1}'
`
mem_free
=
`
vmstat
-s
-S
k |grep
"free memory"
|
awk
'{print $1}'
`
mem_frac
=
`
bc
<<<
"scale=4;
$mem_free
/
$mem_tot
"
`
echo
$mem_frac
#mem_frac=`bc <<< "scale=4;`echo $mem_free`/`echo $mem_tot`"`
echo
"Total Memory =
$mem_tot
k "
echo
"Free Memory =
$mem_free
k"
echo
"Fraction free memory =
$mem_frac
"
res
=
`
bc
<<<
"
$mem_frac
< 0.2"
`
echo
"Comparison Result =
$res
"
if
[
"
$res
"
==
"1"
]
then
echo
"Free memory less than threshold =
$mem_threshold
"
sudo
-E
bash
-c
'echo 3 > /proc/sys/vm/drop_caches '
fi
cmake_targets/tools/build_helper
View file @
2d3333dd
...
...
@@ -284,7 +284,8 @@ check_install_additional_tools (){
wvdial \
python-numpy \
sshpass \
nscd
nscd \
bc
$SUDO pip install paramiko
$SUDO pip install pyroute2
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment