Disclosed is a method for controlling a processor to detect leak from a measured flow of breathable gas. The method of the processor comprises determining a plurality of features from the measured flow of breathable gas, analysing in a processor the plurality of features, and identifying a leak event from the analysing. The leak event is based on a contemporaneous change of the features or based on time and magnitude threshold comparisons.