#!/bin/sh
#
# Runs FreeTTS under the Java profiler. Collects profile information
# in log.txt. Also prints out heap summary information.
#
FREETTS=../../lib/freetts.jar
export FREETTS
java -Xrunhprof:heap=dump,file=log.txt -jar $FREETTS $@
egrep 'OBJ|ARR' log.txt  | sed 's/(//g' | sed 's/,//g' | sed ' s/=/ /g' | awk '
{ size += $4; totalObjects++ }
$1 == "OBJ" { objs++ }
$1 == "ARR" { arr++ }

END { print "Tot:", totalObjects, "Size:", size, "Obj:", objs, "Arr:", arr; }
'
