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