wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.12k stars 673 forks source link

TracyFree with no matching allocation disconnects profiler #572

Open slomp opened 1 year ago

slomp commented 1 year ago

This seems to be a deliberate decision. I was wondering if it would be better to just take note of them (by marking them as "unmatched" in memory profiler window) instead of disconnecting the profiler and dropping the session, since analyzing the events in the profiler can be useful to help "match" the allocation.

occivink commented 1 year ago

I second this. One usecase I have is that I want to record with TracyAlloc/TracyFree at a low level in the stack (e.g. by hooking into malloc), but I only want to record allocations above a certain size threshold. So e.g. during allocation

if (size > 1024)
    TracyAlloc(ptr, size)

but if I just do TracyFree(ptr) blindly during deallocation then it will fail. The only workaround that I can see is manually keeping track of the pointers, but that's cumbersome and feels redundant since Tracy already does it. Maybe a new TracyFree variant that does not require a matching allocation, e.g. TracyFreeO (for optional)?

matt328 commented 1 year ago

I 'third' this? I haven't added any additional tracing related instrumentation to my code, but all the sudden this happens. Is there any way to troubleshoot it?