There is a minimal application on Swift (a test application for locating the problem mostly):
import UIKit import Alamofire class ViewController: UIViewController { let request = AskServer() @IBAction func pressTheButton(_ sender: Any) { AskServer.sendRequest() } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } class AskServer: NSObject { class func sendRequest() { let param: Parameters = ["X1": "12345","X2":"1","X3": "1","X4": "1", "X5": "0.0", "X6": "0", "X7": "g"] let myHost = "http://XXX.XXX.XXX.XXX" Alamofire.request(myHost, method: .post, parameters: param, encoding: JSONEncoding.default).responseJSON{response in } } } by clicking on the button, the server is queried using the Alamofire library. The call fulfills correctly, literally in a fraction of a second. But then about 10-20 seconds, the application eats the processor up to 70%. Accordingly, the battery on the iPhone 6Plus melts before our eyes.
If you comment out Alamofire.request - everything is fine, processor load, God forbid, 1% when you press the button.
What can so consume resources? Help to localize the problem !!!