How to reduce CPU utilization and free up memory footprint while the AVAudioEngine is running fast scheduleBuffer?

I use websocket to get data from the network. When I get data from the network, I will receive the data scheduleBuffer. However, when I run a fast and continuous scheduleBuffer, the CPU utilization and memory footprint will keep increasing. And how can I reduce my CPU usage?

The following is part of my code and a screenshot of the detection

Replies

- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message{



NSData *data = message;


AVAudioPCMBuffer *pcmBuffer = [[AVAudioPCMBuffer alloc]initWithPCMFormat:self.format frameCapacity:

(uint32_t)(data.length) / self.format.streamDescription->mBytesPerFrame];


pcmBuffer.frameLength = pcmBuffer.frameCapacity;



[data getBytes:*pcmBuffer.floatChannelData length:data.length];


[self.playerNode scheduleBuffer:pcmBuffer completionHandler:nil];


}

https://github.com/J844259756/picture.git