7.13.1 Investigating the usage (snapshot) of Explicit heap at a certain point
The method of investigating the usage (snapshot) of Explicit heap at a certain point includes the method for checking the thread dump and the method for acquiring information using Java API.
How to check thread dump You can execute the cjdumpsv command to output a thread dump at any given time. In the thread dump, usage of Explicit heap and each memory block is output. An output example is as follows:
Explicit Heap Status -------------------- max 65536K, total 21376K, used 20480K, garbage 1234K (31.2% used/max, 95.8% used/total, 6.0% garbage/used), 1 spaces exist Explicit Memories(0x12345678) "EJBMgrData" eid=1(0x02f25610)/R, total 21376K, used 20480K, garbage 1234K (95.8% used/total, 6.0% garbage/used, 0 blocks) Enable
The part marked in bold indicates the usage of Explicit heap and the individual Explicit memory block. In this example, the maximum size of Explicit heap is 65,536 Kilobytes and the allocated Explicit heap size is 21,376 Kilobytes. Moreover, the memory allocated size of Explicit memory block called EJBMgrData is 21,376 Kilobytes and the used size is 20,480 Kilobytes.
How to acquire the information with Java API You can acquire the usage of the Explicit heap and the Explicit memory block using the Java API of JavaVM. By implementing the application using the following API, you can acquire the information at any given time of processing.
Method used to acquire the use status of Explicit heap: