Zap C-heap memory at delete/free

XMLWordPrintable

    • b12

        We sometimes have a lifecycle problem with C-heap allocated objects. The most recent I dealt with is JDK-8364501. It would be convenient to have the base delete operators for e.g. CHeapObjBase to zap the contents of the deleted objects to catch these errors.

        Is this even possible in a compatible manner? Are the performance overheads reasonable?

        Is this even a good idea, or should we instead rely on underlying C heap allocators to do this zapping for us? glibc malloc seems to have a tunable, `MALLOC_PERTURB_`/`glibc.malloc.perturb` that might serve our needs. It would be interesting to opt-in to that for debug builds.

              Assignee:
              Aleksey Shipilev
              Reporter:
              Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: