-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·45 lines (33 loc) · 755 Bytes
/
run.sh
File metadata and controls
executable file
·45 lines (33 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
OUTPUT=/tmp/nativememory.out
if [ "$#" -lt 3 ]; then
echo "usage: $0 <threads> <chunkSizeMB> <chunksPerThread>"
exit 1
fi
echo "MALLOC_TRIM_THRESHOLD_=${MALLOC_TRIM_THRESHOLD_} ; MALLOC_TOP_PAD_=${MALLOC_TOP_PAD_}"
(java -jar build/libs/nativememory-1.0-SNAPSHOT-all.jar $@ > ${OUTPUT} 2>&1) &
nm_pid=$!
function cleanup {
kill ${nm_pid}
echo "killed pid ${nm_pid}"
}
function report {
date=$(date)
echo "=========== ${date} ==========="
#cat /proc/${nm_pid}/status | grep -E '^Rss|^Vm'
#echo
pmap -x ${nm_pid} | grep ^total
}
trap cleanup EXIT
# give nativememory some time to start
sleep 10
nm_output=$(cat ${OUTPUT} | grep ^pid)
echo ${nm_output}
report
sleep 30
report
#while true
#do
# report
# sleep 30
#done