PresentMon icon indicating copy to clipboard operation
PresentMon copied to clipboard

Need to adjust trace buffer size/limit

Open malikm opened this issue 1 month ago • 0 comments

Some users report getting a "The backing-file for the real-time session "..." has reached its maximum size. As a result, new events will not be logged to this session until space becomes available. This error is often caused by starting a trace session in real-time mode without having any real-time consumers."

I suspect this is due to the buffer size limit set (or rather not set) for the real-time trace session. PM doesn't set BufferSize, MinimumBuffers or MaximumBuffers when starting a session, so Windows sets this automatically. In this case, Windows sets the following:

  • Buffer size: 64 KB
  • Minimum buffers: 256
  • Maximum buffers: 278

I think we need to increase the sessionProps.MaximumBuffers value prior to StartTraceW call, or do a ControlTraceW( ..., EVENT_TRACE_CONTROL_UPDATE) later. It might also be good to let the application specify this value via a parameter.

malikm avatar Nov 24 '25 08:11 malikm