I have the below block of data.
Heap after GC invocations=31 (full 3):
par new generation total 131008K, used 0K [0x00000000eac00000, 0x00000000f2c00000, 0x00000000f2c00000)
eden space 130944K, 0% used [0x00000000eac00000, 0x00000000eac00000, 0x00000000f2be0000)
from space 64K, 0% used [0x00000000f2be0000, 0x00000000f2be0000, 0x00000000f2bf0000)
to space 64K, 0% used [0x00000000f2bf0000, 0x00000000f2bf0000, 0x00000000f2c00000)
concurrent mark-sweep generation total 131072K, used 48549K [0x00000000f2c00000, 0x00000000fac00000, 0x00000000fac00000)
concurrent-mark-sweep perm gen total 30000K, used 19518K [0x00000000fac00000, 0x00000000fc94c000, 0x0000000100000000)
}
I need to extract the below data of "total" and "used" numeric data without "K" for the below. i.e. value1=131008, value2=0,value3=131072,value4=48549,value5=30000 and value6=19518
should be extracted from the below:
par new generation ***total*** 131008K, ***used*** 0K
concurrent mark-sweep generation ***total*** 131072K, used 48549K
concurrent-mark-sweep perm gen ***total*** 30000K, ***used*** 19518K
I know how to extract the data for fixed length values like below.
value1=`grep "par new generation" | cut -c27-31
However, the above block of data has variable length values.