Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
e659a0d9
Commit
e659a0d9
authored
Sep 26, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab CI: fix for cleaning memory only when critically low
parent
8afa1e59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
cmake_targets/autotests/tools/free_mem.bash
cmake_targets/autotests/tools/free_mem.bash
+21
-1
cmake_targets/tools/build_helper
cmake_targets/tools/build_helper
+2
-1
No files found.
cmake_targets/autotests/tools/free_mem.bash
View file @
e659a0d9
...
...
@@ -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 @
e659a0d9
...
...
@@ -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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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