| 165 | | * MEM_TOTAL_BLOCK(number_of_bytes) emitted after each GC, with the total memory of blocks allocated inside the mblocks allocated from the OS, used to calculated the memory lost due to fragmentation of mblocks |
| | 163 | In the above events, the "allocated since prog start" is done per-HEC, but the heap total size and live data size apply to the heap as a whole, not a particular HEC. |
| | 164 | |
| | 165 | For completeness / future-proofing it may be wise to explicitly identify heaps and to have the heap size/live events tag the heap to which they apply. Remember that we can merge event logs from multiple processes, so there is already no truly global notion of heap, implicitly it would be the single heap belonging to the HEC that emits the event. We would also have to make the assumption that there is a single heap per OS process (we can already identify which HECs belong to the same OS process). Alternatively we can explicitly identify heaps using the existing capset (capability set) mechanism. We would add a new capset type: |
| | 166 | |
| | 167 | {{{ |
| | 168 | /* |
| | 169 | * Capset type values for EVENT_CAPSET_CREATE |
| | 170 | */ |
| | 171 | #define CAPSET_TYPE_CUSTOM 1 /* reserved for end-user applications */ |
| | 172 | #define CAPSET_TYPE_OSPROCESS 2 /* caps belong to the same OS process */ |
| | 173 | #define CAPSET_TYPE_CLOCKDOMAIN 3 /* caps share a local clock/time */ |
| | 174 | #define CAPSET_TYPE_GCHEAP 4 /* caps share a GC'd heap */ |
| | 175 | }}} |
| | 176 | |
| | 177 | We would then make a capset for the main heap and add all HECs to it. The `EVENT_HEAP_SIZE` and `EVENT_HEAP_LIVE` events would then have a capset argument to indicate the heap. |
| | 178 | |
| | 179 | If in future we allow multiple independent heaps in the same OS process (e.g. separate RTS instances) then this would let us cope. Similarly it'd cope with implementations like GdH which use a global heap spanning multiple OS processes. Would it be useful for talking about per-HEC local heaps? |
| 169 | | Extra "generation" parameter is needed for one of GC_START or GC_END. |
| 170 | | If we have the extra parameter in both, we can do more with partial eventlogs |
| 171 | | that lack starts of ends of some GCs, and it's easier to calculate stats |
| 172 | | for selected time intervals. When the RequestSeqGC and RequestParGC events |
| 173 | | are emitted, it's not yet know if the GC will be major or minor, so no extra |
| 174 | | parameters should be added to them. |
| | 183 | * modify `EVENT_GC_START` to add a `(generation)` field. The generation number in a generational GC scheme. Use -1 if not applicable. |
| | 184 | |
| | 185 | When the RequestSeqGC and RequestParGC events are emitted, it's not yet know if the GC will be major or minor, so no extra parameters should be added to them. |