In a CPAP or positive pressure ventilation system, leak is determined at each instant by a lookback for a time as long as single breath to establish the start of an averaging window over which low-pass filtered values used in the determination of a parameter of a leak model are averaged. A jamming index indicates whether the leak is rapidly changing. To the extent that jamming is high, the leak estimate used progressively changes from that using sliding breath-window averaging to a more robust and faster responding low-pass filter method, and adjustment of ventilatory support based on measures employing estimated respiratory flow is slowed down or stopped.