I have an ant script that is executing a jmx get task:
<jmx:get
name="java.lang:type=GarbageCollector,name=Copy"
attribute="LastGcInfo"
resultproperty="CopyLastGcInfo"
/>
Now, the LastGcInfo attribute has a map Map called memoryUsageBeforeGC. In this map there is a pair with a key called “value”. Althoug I am unable to elicit it and print it out. I have tried to accomplish it like that:
<echo>${CopyLastGcInfo.memoryUsageBeforeGc.value.used}</echo>
<echo>${CopyLastGcInfo.memoryUsageBeforeGc.0.used}</echo>
<echo>${CopyLastGcInfo.memoryUsageBeforeGc.used}</echo>
That didn’t work. Do you have any suggestions how to tackle this problem?
Thanks.
The following example worked for me:
Example output
Note