I wanted to grep for java process and then find the max heap memory used.
I tried this
def ex =['sh','-c','ps -aef | grep Xmx'] String str = ex.execute().text
str has something like java -Xmx1024M /kv/classes/bebo/ -Xms512M
How do I extract the value 1024M? I was planning to user java regex but thought someone might know a cool way in groovy.