1 /* -----------------------------------------------------------------------------
2 * $Id: ProfHeap.c,v 1.51 2004/03/19 23:20:20 panne Exp $
4 * (c) The GHC Team, 1998-2003
6 * Support for heap profiling
8 * ---------------------------------------------------------------------------*/
10 #if defined(DEBUG) && !defined(PROFILING)
11 #define DEBUG_HEAP_PROF
13 #undef DEBUG_HEAP_PROF
16 #if defined(PROFILING) || defined(DEBUG_HEAP_PROF)
18 #include "PosixSource.h"
22 #include "Profiling.h"
28 #include "RetainerProfile.h"
29 #include "LdvProfile.h"
36 /* -----------------------------------------------------------------------------
37 * era stores the current time period. It is the same as the
38 * number of censuses that have been performed.
41 * era must be no longer than LDV_SHIFT (15 or 30) bits.
43 * era is initialized to 1 in initHeapProfiling().
45 * max_era is initialized to 2^LDV_SHIFT in initHeapProfiling().
46 * When era reaches max_era, the profiling stops because a closure can
47 * store only up to (max_era - 1) as its creation or last use time.
48 * -------------------------------------------------------------------------- */
52 /* -----------------------------------------------------------------------------
55 * For most heap profiles each closure identity gets a simple count
56 * of live words in the heap at each census. However, if we're
57 * selecting by biography, then we have to keep the various
58 * lag/drag/void counters for each identity.
59 * -------------------------------------------------------------------------- */
60 typedef struct _counter {
65 int prim; // total size of 'inherently used' closures
66 int not_used; // total size of 'never used' closures
67 int used; // total size of 'used at least once' closures
68 int void_total; // current total size of 'destroyed without being used' closures
69 int drag_total; // current total size of 'used at least once and waiting to die'
72 struct _counter *next;
76 initLDVCtr( counter *ctr )
79 ctr->c.ldv.not_used = 0;
81 ctr->c.ldv.void_total = 0;
82 ctr->c.ldv.drag_total = 0;
86 double time; // the time in MUT time when the census is made
91 // for LDV profiling, when just displaying by LDV
99 static Census *censuses = NULL;
100 static nat n_censuses = 0;
103 static void aggregateCensusInfo( void );
106 static void dumpCensus( Census *census );
108 /* -----------------------------------------------------------------------------
109 Closure Type Profiling;
111 PROBABLY TOTALLY OUT OF DATE -- ToDo (SDM)
112 -------------------------------------------------------------------------- */
114 #ifdef DEBUG_HEAP_PROF
115 static char *type_names[] = {
121 , "CONSTR_NOCAF_STATIC"
159 , "MUT_ARR_PTRS_FROZEN"
173 #endif /* DEBUG_HEAP_PROF */
175 /* -----------------------------------------------------------------------------
176 * Find the "closure identity", which is a unique pointer reresenting
177 * the band to which this closure's heap space is attributed in the
179 * ------------------------------------------------------------------------- */
181 closureIdentity( StgClosure *p )
183 switch (RtsFlags.ProfFlags.doHeapProfile) {
187 return p->header.prof.ccs;
189 return p->header.prof.ccs->cc->module;
191 return get_itbl(p)->prof.closure_desc;
193 return get_itbl(p)->prof.closure_type;
194 case HEAP_BY_RETAINER:
195 // AFAIK, the only closures in the heap which might not have a
196 // valid retainer set are DEAD_WEAK closures.
197 if (isRetainerSetFieldValid(p))
198 return retainerSetOf(p);
203 case HEAP_BY_INFOPTR:
204 return (void *)((StgClosure *)p)->header.info;
205 case HEAP_BY_CLOSURE_TYPE:
206 return type_names[get_itbl(p)->type];
210 barf("closureIdentity");
214 /* --------------------------------------------------------------------------
215 * Profiling type predicates
216 * ----------------------------------------------------------------------- */
218 STATIC_INLINE rtsBool
219 doingLDVProfiling( void )
221 return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV
222 || RtsFlags.ProfFlags.bioSelector != NULL);
225 STATIC_INLINE rtsBool
226 doingRetainerProfiling( void )
228 return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER
229 || RtsFlags.ProfFlags.retainerSelector != NULL);
233 // Precesses a closure 'c' being destroyed whose size is 'size'.
234 // Make sure that LDV_recordDead() is not invoked on 'inherently used' closures
235 // such as TSO; they should not be involved in computing dragNew or voidNew.
237 // Even though era is checked in both LdvCensusForDead() and
238 // LdvCensusKillAll(), we still need to make sure that era is > 0 because
239 // LDV_recordDead() may be called from elsewhere in the runtime system. E.g.,
240 // when a thunk is replaced by an indirection object.
244 LDV_recordDead( StgClosure *c, nat size )
250 if (era > 0 && closureSatisfiesConstraints(c)) {
251 size -= sizeofW(StgProfHeader);
252 if ((LDVW((c)) & LDV_STATE_MASK) == LDV_STATE_CREATE) {
253 t = (LDVW((c)) & LDV_CREATE_MASK) >> LDV_SHIFT;
255 if (RtsFlags.ProfFlags.bioSelector == NULL) {
256 censuses[t].void_total += (int)size;
257 censuses[era].void_total -= (int)size;
259 id = closureIdentity(c);
260 ctr = lookupHashTable(censuses[t].hash, (StgWord)id);
261 ASSERT( ctr != NULL );
262 ctr->c.ldv.void_total += (int)size;
263 ctr = lookupHashTable(censuses[era].hash, (StgWord)id);
265 ctr = arenaAlloc(censuses[era].arena, sizeof(counter));
267 insertHashTable(censuses[era].hash, (StgWord)id, ctr);
269 ctr->next = censuses[era].ctrs;
270 censuses[era].ctrs = ctr;
272 ctr->c.ldv.void_total -= (int)size;
276 t = LDVW((c)) & LDV_LAST_MASK;
278 if (RtsFlags.ProfFlags.bioSelector == NULL) {
279 censuses[t+1].drag_total += size;
280 censuses[era].drag_total -= size;
283 id = closureIdentity(c);
284 ctr = lookupHashTable(censuses[t+1].hash, (StgWord)id);
285 ASSERT( ctr != NULL );
286 ctr->c.ldv.drag_total += (int)size;
287 ctr = lookupHashTable(censuses[era].hash, (StgWord)id);
289 ctr = arenaAlloc(censuses[era].arena, sizeof(counter));
291 insertHashTable(censuses[era].hash, (StgWord)id, ctr);
293 ctr->next = censuses[era].ctrs;
294 censuses[era].ctrs = ctr;
296 ctr->c.ldv.drag_total -= (int)size;
304 /* --------------------------------------------------------------------------
305 * Initialize censuses[era];
306 * ----------------------------------------------------------------------- */
308 initEra(Census *census)
310 census->hash = allocHashTable();
312 census->arena = newArena();
314 census->not_used = 0;
317 census->void_total = 0;
318 census->drag_total = 0;
321 /* --------------------------------------------------------------------------
322 * Increases era by 1 and initialize census[era].
323 * Reallocates gi[] and increases its size if needed.
324 * ----------------------------------------------------------------------- */
329 if (doingLDVProfiling()) {
332 if (era == max_era) {
333 prog_belch("maximum number of censuses reached; use +RTS -i to reduce");
334 stg_exit(EXIT_FAILURE);
337 if (era == n_censuses) {
339 censuses = stgReallocBytes(censuses, sizeof(Census) * n_censuses,
345 initEra( &censuses[era] );
348 /* -----------------------------------------------------------------------------
349 * DEBUG heap profiling, by info table
350 * -------------------------------------------------------------------------- */
352 #ifdef DEBUG_HEAP_PROF
354 static char *hp_filename;
356 void initProfiling1( void )
360 void initProfiling2( void )
362 if (RtsFlags.ProfFlags.doHeapProfile) {
363 /* Initialise the log file name */
364 hp_filename = stgMallocBytes(strlen(prog_name) + 6, "hpFileName");
365 sprintf(hp_filename, "%s.hp", prog_name);
367 /* open the log file */
368 if ((hp_file = fopen(hp_filename, "w")) == NULL) {
369 fprintf(stderr, "Can't open profiling report file %s\n",
371 RtsFlags.ProfFlags.doHeapProfile = 0;
379 void endProfiling( void )
383 #endif /* DEBUG_HEAP_PROF */
385 /* --------------------------------------------------------------------------
386 * Initialize the heap profilier
387 * ----------------------------------------------------------------------- */
389 initHeapProfiling(void)
391 if (! RtsFlags.ProfFlags.doHeapProfile) {
396 if (doingLDVProfiling() && doingRetainerProfiling()) {
397 prog_belch("cannot mix -hb and -hr");
402 // we only count eras if we're doing LDV profiling. Otherwise era
405 if (doingLDVProfiling()) {
413 { // max_era = 2^LDV_SHIFT
416 for (p = 0; p < LDV_SHIFT; p++)
421 censuses = stgMallocBytes(sizeof(Census) * n_censuses, "initHeapProfiling");
423 initEra( &censuses[era] );
425 /* initProfilingLogFile(); */
426 fprintf(hp_file, "JOB \"%s", prog_name);
431 for(count = 1; count < prog_argc; count++)
432 fprintf(hp_file, " %s", prog_argv[count]);
433 fprintf(hp_file, " +RTS");
434 for(count = 0; count < rts_argc; count++)
435 fprintf(hp_file, " %s", rts_argv[count]);
437 #endif /* PROFILING */
439 fprintf(hp_file, "\"\n" );
441 fprintf(hp_file, "DATE \"%s\"\n", time_str());
443 fprintf(hp_file, "SAMPLE_UNIT \"seconds\"\n");
444 fprintf(hp_file, "VALUE_UNIT \"bytes\"\n");
446 fprintf(hp_file, "BEGIN_SAMPLE 0.00\n");
447 fprintf(hp_file, "END_SAMPLE 0.00\n");
449 #ifdef DEBUG_HEAP_PROF
450 DEBUG_LoadSymbols(prog_name);
454 if (doingRetainerProfiling()) {
455 initRetainerProfiling();
463 endHeapProfiling(void)
467 if (! RtsFlags.ProfFlags.doHeapProfile) {
472 if (doingRetainerProfiling()) {
473 endRetainerProfiling();
478 if (doingLDVProfiling()) {
481 aggregateCensusInfo();
482 for (t = 1; t < era; t++) {
483 dumpCensus( &censuses[t] );
488 seconds = mut_user_time();
489 fprintf(hp_file, "BEGIN_SAMPLE %0.2f\n", seconds);
490 fprintf(hp_file, "END_SAMPLE %0.2f\n", seconds);
498 buf_append(char *p, const char *q, char *end)
502 for (m = 0; p < end; p++, q++, m++) {
504 if (*q == '\0') { break; }
510 fprint_ccs(FILE *fp, CostCentreStack *ccs, nat max_length)
512 char buf[max_length+1], *p, *buf_end;
516 // MAIN on its own gets printed as "MAIN", otherwise we ignore MAIN.
517 if (ccs == CCS_MAIN) {
522 fprintf(fp, "(%d)", ccs->ccsID);
525 buf_end = buf + max_length + 1;
527 // keep printing components of the stack until we run out of space
528 // in the buffer. If we run out of space, end with "...".
529 for (; ccs != NULL && ccs != CCS_MAIN; ccs = ccs->prevStack) {
531 // CAF cost centres print as M.CAF, but we leave the module
532 // name out of all the others to save space.
533 if (!strcmp(ccs->cc->label,"CAF")) {
534 p += buf_append(p, ccs->cc->module, buf_end);
535 p += buf_append(p, ".CAF", buf_end);
537 if (ccs->prevStack != NULL && ccs->prevStack != CCS_MAIN) {
538 p += buf_append(p, "/", buf_end);
540 p += buf_append(p, ccs->cc->label, buf_end);
544 sprintf(buf+max_length-4, "...");
547 next_offset += written;
550 fprintf(fp, "%s", buf);
555 strMatchesSelector( char* str, char* sel )
558 // fprintf(stderr, "str_matches_selector %s %s\n", str, sel);
560 // Compare str against wherever we've got to in sel.
562 while (*p != '\0' && *sel != ',' && *sel != '\0' && *p == *sel) {
565 // Match if all of str used and have reached the end of a sel fragment.
566 if (*p == '\0' && (*sel == ',' || *sel == '\0'))
569 // No match. Advance sel to the start of the next elem.
570 while (*sel != ',' && *sel != '\0') sel++;
571 if (*sel == ',') sel++;
573 /* Run out of sel ?? */
574 if (*sel == '\0') return rtsFalse;
578 /* -----------------------------------------------------------------------------
579 * Figure out whether a closure should be counted in this census, by
580 * testing against all the specified constraints.
581 * -------------------------------------------------------------------------- */
583 closureSatisfiesConstraints( StgClosure* p )
585 #ifdef DEBUG_HEAP_PROF
590 // The CCS has a selected field to indicate whether this closure is
591 // deselected by not being mentioned in the module, CC, or CCS
593 if (!p->header.prof.ccs->selected) {
597 if (RtsFlags.ProfFlags.descrSelector) {
598 b = strMatchesSelector( (get_itbl((StgClosure *)p))->prof.closure_desc,
599 RtsFlags.ProfFlags.descrSelector );
600 if (!b) return rtsFalse;
602 if (RtsFlags.ProfFlags.typeSelector) {
603 b = strMatchesSelector( (get_itbl((StgClosure *)p))->prof.closure_type,
604 RtsFlags.ProfFlags.typeSelector );
605 if (!b) return rtsFalse;
607 if (RtsFlags.ProfFlags.retainerSelector) {
610 // We must check that the retainer set is valid here. One
611 // reason it might not be valid is if this closure is a
612 // a newly deceased weak pointer (i.e. a DEAD_WEAK), since
613 // these aren't reached by the retainer profiler's traversal.
614 if (isRetainerSetFieldValid((StgClosure *)p)) {
615 rs = retainerSetOf((StgClosure *)p);
617 for (i = 0; i < rs->num; i++) {
618 b = strMatchesSelector( rs->element[i]->cc->label,
619 RtsFlags.ProfFlags.retainerSelector );
620 if (b) return rtsTrue;
627 #endif /* PROFILING */
630 /* -----------------------------------------------------------------------------
631 * Aggregate the heap census info for biographical profiling
632 * -------------------------------------------------------------------------- */
635 aggregateCensusInfo( void )
639 counter *c, *d, *ctrs;
642 if (!doingLDVProfiling()) return;
644 // Aggregate the LDV counters when displaying by biography.
645 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
646 int void_total, drag_total;
648 // Now we compute void_total and drag_total for each census
651 for (t = 1; t < era; t++) { // note: start at 1, not 0
652 void_total += censuses[t].void_total;
653 drag_total += censuses[t].drag_total;
654 censuses[t].void_total = void_total;
655 censuses[t].drag_total = drag_total;
656 ASSERT( censuses[t].void_total <= censuses[t].not_used );
657 ASSERT( censuses[t].drag_total <= censuses[t].used );
663 // otherwise... we're doing a heap profile that is restricted to
664 // some combination of lag, drag, void or use. We've kept all the
665 // census info for all censuses so far, but we still need to
666 // aggregate the counters forwards.
669 acc = allocHashTable();
672 for (t = 1; t < era; t++) {
674 // first look through all the counters we're aggregating
675 for (c = ctrs; c != NULL; c = c->next) {
676 // if one of the totals is non-zero, then this closure
677 // type must be present in the heap at this census time...
678 d = lookupHashTable(censuses[t].hash, (StgWord)c->identity);
681 // if this closure identity isn't present in the
682 // census for this time period, then our running
683 // totals *must* be zero.
684 ASSERT(c->c.ldv.void_total == 0 && c->c.ldv.drag_total == 0);
686 // fprintCCS(stderr,c->identity);
687 // fprintf(stderr," census=%d void_total=%d drag_total=%d\n",
688 // t, c->c.ldv.void_total, c->c.ldv.drag_total);
690 d->c.ldv.void_total += c->c.ldv.void_total;
691 d->c.ldv.drag_total += c->c.ldv.drag_total;
692 c->c.ldv.void_total = d->c.ldv.void_total;
693 c->c.ldv.drag_total = d->c.ldv.drag_total;
695 ASSERT( c->c.ldv.void_total >= 0 );
696 ASSERT( c->c.ldv.drag_total >= 0 );
700 // now look through the counters in this census to find new ones
701 for (c = censuses[t].ctrs; c != NULL; c = c->next) {
702 d = lookupHashTable(acc, (StgWord)c->identity);
704 d = arenaAlloc( arena, sizeof(counter) );
706 insertHashTable( acc, (StgWord)c->identity, d );
707 d->identity = c->identity;
710 d->c.ldv.void_total = c->c.ldv.void_total;
711 d->c.ldv.drag_total = c->c.ldv.drag_total;
713 ASSERT( c->c.ldv.void_total >= 0 );
714 ASSERT( c->c.ldv.drag_total >= 0 );
718 freeHashTable(acc, NULL);
723 /* -----------------------------------------------------------------------------
724 * Print out the results of a heap census.
725 * -------------------------------------------------------------------------- */
727 dumpCensus( Census *census )
732 fprintf(hp_file, "BEGIN_SAMPLE %0.2f\n", census->time);
735 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
736 fprintf(hp_file, "VOID\t%u\n", census->void_total * sizeof(W_));
737 fprintf(hp_file, "LAG\t%u\n",
738 (census->not_used - census->void_total) * sizeof(W_));
739 fprintf(hp_file, "USE\t%u\n",
740 (census->used - census->drag_total) * sizeof(W_));
741 fprintf(hp_file, "INHERENT_USE\t%u\n",
742 census->prim * sizeof(W_));
743 fprintf(hp_file, "DRAG\t%u\n", census->drag_total *
745 fprintf(hp_file, "END_SAMPLE %0.2f\n", census->time);
750 for (ctr = census->ctrs; ctr != NULL; ctr = ctr->next) {
753 if (RtsFlags.ProfFlags.bioSelector != NULL) {
755 if (strMatchesSelector("lag", RtsFlags.ProfFlags.bioSelector))
756 count += ctr->c.ldv.not_used - ctr->c.ldv.void_total;
757 if (strMatchesSelector("drag", RtsFlags.ProfFlags.bioSelector))
758 count += ctr->c.ldv.drag_total;
759 if (strMatchesSelector("void", RtsFlags.ProfFlags.bioSelector))
760 count += ctr->c.ldv.void_total;
761 if (strMatchesSelector("use", RtsFlags.ProfFlags.bioSelector))
762 count += ctr->c.ldv.used - ctr->c.ldv.drag_total;
766 count = ctr->c.resid;
769 ASSERT( count >= 0 );
771 if (count == 0) continue;
773 #ifdef DEBUG_HEAP_PROF
774 switch (RtsFlags.ProfFlags.doHeapProfile) {
775 case HEAP_BY_INFOPTR:
776 fprintf(hp_file, "%s", lookupGHCName(ctr->identity));
778 case HEAP_BY_CLOSURE_TYPE:
779 fprintf(hp_file, "%s", (char *)ctr->identity);
785 switch (RtsFlags.ProfFlags.doHeapProfile) {
787 fprint_ccs(hp_file, (CostCentreStack *)ctr->identity, 25);
792 fprintf(hp_file, "%s", (char *)ctr->identity);
794 case HEAP_BY_RETAINER:
796 RetainerSet *rs = (RetainerSet *)ctr->identity;
798 // it might be the distinguished retainer set rs_MANY:
799 if (rs == &rs_MANY) {
800 fprintf(hp_file, "MANY");
804 // Mark this retainer set by negating its id, because it
805 // has appeared in at least one census. We print the
806 // values of all such retainer sets into the log file at
807 // the end. A retainer set may exist but not feature in
808 // any censuses if it arose as the intermediate retainer
809 // set for some closure during retainer set calculation.
813 // report in the unit of bytes: * sizeof(StgWord)
814 printRetainerSetShort(hp_file, rs);
818 barf("dumpCensus; doHeapProfile");
822 fprintf(hp_file, "\t%d\n", count * sizeof(W_));
825 fprintf(hp_file, "END_SAMPLE %0.2f\n", census->time);
828 /* -----------------------------------------------------------------------------
829 * Code to perform a heap census.
830 * -------------------------------------------------------------------------- */
832 heapCensusChain( Census *census, bdescr *bd )
842 for (; bd != NULL; bd = bd->link) {
844 // HACK: ignore pinned blocks, because they contain gaps.
845 // It's not clear exactly what we'd like to do here, since we
846 // can't tell which objects in the block are actually alive.
847 // Perhaps the whole block should be counted as SYSTEM memory.
848 if (bd->flags & BF_PINNED) {
853 while (p < bd->free) {
854 info = get_itbl((StgClosure *)p);
857 switch (info->type) {
864 case IND_OLDGEN_PERM:
866 case SE_CAF_BLACKHOLE:
871 case CONSTR_CHARLIKE:
885 size = sizeW_fromITBL(info);
890 size = bco_sizeW((StgBCO *)p);
900 size = sizeW_fromITBL(info);
903 case THUNK_1_0: /* ToDo - shouldn't be here */
904 case THUNK_0_1: /* " ditto " */
906 size = sizeofW(StgHeader) + MIN_UPD_SIZE;
911 size = pap_sizeW((StgPAP *)p);
915 size = ap_stack_sizeW((StgAP_STACK *)p);
920 size = arr_words_sizeW(stgCast(StgArrWords*,p));
924 case MUT_ARR_PTRS_FROZEN:
926 size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)p);
931 #ifdef DEBUG_HEAP_PROF
932 size = tso_sizeW((StgTSO *)p);
935 if (RtsFlags.ProfFlags.includeTSOs) {
936 size = tso_sizeW((StgTSO *)p);
939 // Skip this TSO and move on to the next object
940 p += tso_sizeW((StgTSO *)p);
951 #ifdef DEBUG_HEAP_PROF
954 // subtract the profiling overhead
955 real_size = size - sizeofW(StgProfHeader);
958 if (closureSatisfiesConstraints((StgClosure*)p)) {
960 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
962 census->prim += real_size;
963 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
964 census->not_used += real_size;
966 census->used += real_size;
970 identity = closureIdentity((StgClosure *)p);
972 if (identity != NULL) {
973 ctr = lookupHashTable( census->hash, (StgWord)identity );
976 if (RtsFlags.ProfFlags.bioSelector != NULL) {
978 ctr->c.ldv.prim += real_size;
979 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
980 ctr->c.ldv.not_used += real_size;
982 ctr->c.ldv.used += real_size;
986 ctr->c.resid += real_size;
989 ctr = arenaAlloc( census->arena, sizeof(counter) );
991 insertHashTable( census->hash, (StgWord)identity, ctr );
992 ctr->identity = identity;
993 ctr->next = census->ctrs;
997 if (RtsFlags.ProfFlags.bioSelector != NULL) {
999 ctr->c.ldv.prim = real_size;
1000 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
1001 ctr->c.ldv.not_used = real_size;
1003 ctr->c.ldv.used = real_size;
1007 ctr->c.resid = real_size;
1025 census = &censuses[era];
1026 census->time = mut_user_time();
1028 // calculate retainer sets if necessary
1030 if (doingRetainerProfiling()) {
1036 stat_startHeapCensus();
1039 // Traverse the heap, collecting the census info
1041 // First the small_alloc_list: we have to fix the free pointer at
1042 // the end by calling tidyAllocatedLists() first.
1043 tidyAllocateLists();
1044 heapCensusChain( census, small_alloc_list );
1046 // Now traverse the heap in each generation/step.
1047 if (RtsFlags.GcFlags.generations == 1) {
1048 heapCensusChain( census, g0s0->to_blocks );
1050 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
1051 for (s = 0; s < generations[g].n_steps; s++) {
1052 heapCensusChain( census, generations[g].steps[s].blocks );
1053 // Are we interested in large objects? might be
1054 // confusing to include the stack in a heap profile.
1055 heapCensusChain( census, generations[g].steps[s].large_objects );
1060 // dump out the census info
1062 // We can't generate any info for LDV profiling until
1063 // the end of the run...
1064 if (!doingLDVProfiling())
1065 dumpCensus( census );
1067 dumpCensus( census );
1071 // free our storage, unless we're keeping all the census info for
1072 // future restriction by biography.
1074 if (RtsFlags.ProfFlags.bioSelector == NULL)
1077 freeHashTable( census->hash, NULL/* don't free the elements */ );
1078 arenaFree( census->arena );
1079 census->hash = NULL;
1080 census->arena = NULL;
1083 // we're into the next time period now
1087 stat_endHeapCensus();
1091 #endif /* PROFILING || DEBUG_HEAP_PROF */