Posts

Post marked as solved
6 Replies
2.5k Views
I am running into a memory issue when running my UI automated tests with XCTestCase in iOS 9. When I launch my UI tests I see two processes get kicked off in xcode, one for the app I am testing and one for the actual UI tests. My app's memory stays around 60 MB, but the UI test grows to around 400 MB before the device kills it for using too much memory. My UI test is pretty simple, where I am just tapping buttons as I go through a test in my app. All of the code looks similar to this, though I go through about 30 questions:app.buttons["next question button"].tap() // Move to the next question app.staticTexts["Correct answer text"].tap() // Select the correct answerAt first I thougth that maybe it was how I was doing asserts, since I was using waitForExpectationsWithTimeout. But taking these out doesn't seem to have any effect. It's seems like as my UI updates (and my app UI is going through a lot of views, it is a VERY visual testing app) the XCUIElementQuery items may be keeping track of the entire UI history. So, as my app creates new elements the RAM usage of the UI test skyrockets. See below for an example of what I am seeing in XCode:Does anyone know of anyway to reset/release this memory? Reinitializing let app = XCUIApplication() doesn't seem to do anything. Or does this seem like a memory leak in the UI automation framework?
Posted
by lehn0058.
Last updated
.
Post not yet marked as solved
3 Replies
889 Views
I have adopted the new background task API in watchOS 3 and my complications start updating as expected. I have a single background task that gets scheduled every 30 minutes, so I should only be using 48 of the 50 updates per day given to the complication (mentioned in the Keeping your Watch Apps Up To Date WWDC video). However, it seems like the complication often stops updating. This is particulary noticable after the user takes off the watch and it is locked for several hours (such as when they go to bed overnight). The next morning the complications don't start updating until I manually launch the watch app. This is particulary odd because I only schedule a complication refresh when a background task is fired, so launching my app that was still in memory (verified because of how fast it is launching) does not cause the app to refresh. It seems like the background tasks are suspended for a time when certain conditions are met and are not being re-initialized.Has anyone else seen this issue? I have noticed that having the app in the dock seems to reduce the likelyhood of this happening, but does still happen on ocassion.
Posted
by lehn0058.
Last updated
.