Hi all,
I appreciate your help with this problem, I'm really stuck.
One of my beta testers reports frequent crashes of my app. The iOS log reports:
Apr 15 23:52:14 iPhone SpringBoard[58] <Warning>: Application 'UIKitApplication:de.loffler.XBMCMusicRemotePro[0x553a]' was killed by jetsam.
Apr 15 23:52:14 iPhone UserEventAgent[26] <Warning>: 440891049998: id=de.loffler.XBMCMusicRemotePro pid=1518, state=0
So the app was killed because of a low memory condition. Usually, I'd know what do do (look for leaks etc), however, there are some issues that are really strange:
1. Low memory usage
According to the JetsamEvent.ips, the memory usage of my app is just 32MB (if I interpret the report correctly: 2050 resident pages * 16384 page size). The tester has an iPhone 6S with 2GB of RAM, so at the point of the crash, the app uses no more than 2% of the entire memory of the device. Additionally, if I sum up the "rpages" of all entries in the report, I'm just getting ca. 620MB of usage. Maybe I'm having some misunderstandings reading the report...
I wrote a test function that just consumes memory until the app is killed. When running this function on my iPhone 5S, the app only gets killed by the time it reaches 600MB memory usage.
{"timestamp":"2016-04-15 23:52:13.13 +0200","bug_type":"298","os_version":"iPhone OS 9.3 (13E234)"}
{
"crashReporterKey" : "bec1fa98267fbf2d761102140fcf61aa7b6b5e25",
"kernel" : "Darwin Kernel Version 15.4.0: Fri Feb 19 13:54:52 PST 2016; root:xnu-3248.41.4~28\/RELEASE_ARM64_S8000",
"product" : "iPhone8,1",
"incident" : "A2B3C5FF-8ECC-4E07-BEDA-E847061F396B",
"date" : "2016-04-15 23:52:13.13 +0200",
"build" : "iPhone OS 9.3 (13E234)",
"timeDelta" : 1739,
"memoryStatus" : {
"compressorSize" : 76679,
"pageSize" : 16384,
"compressions" : 2526427,
"memoryPages" : {
"active" : 24493,
"throttled" : 0,
"fileBacked" : 24113,
"wired" : 13007,
"anonymous" : 12915,
"purgeable" : 127,
"inactive" : 10955,
"free" : 2290,
"speculative" : 1580
},
"uncompressed" : 125795,
"decompressions" : 143684
},
"largestProcess" : "Facebook",
"processes" : [
{
...
{
"rpages" : 2050,
"states" : [
"frontmost",
"resume"
],
"name" : "KodiMusicRemoteP",
"pid" : 1518,
"reason" : "vm-thrashing",
"fds" : 50,
"uuid" : "5103a88a-917f-319e-8553-c0189dd1abac",
"purgeable" : 127,
"cpuTime" : 4.619693,
"lifetimeMax" : 3557
},
...
}
2. No memory warnings
I'm writing low memory warnings to a log file (via Cocoa Lumberjack), but in my tester's log I cannot find any such log output. I tested the code with my test function, and it worked fine.
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
DDLogError(@"applicationDidReceiveMemoryWarning");
[DDLog flushLog];
// ... (do some other stuff, release memory)
}
3. Not seen anywhere else
Noone of the other ten beta testers reported this problem, and I haven't seen it myself with my iPhone 5S, which has half of the memory of the 6S.
4. No typical memory crash scenario
My tester reported that the app sometimes runs fine for some time, but when it crashes and he restarts it, it often crashes quickly again (like after 10s). Based on the architecture of my app, I don't see how a memory leak could cause a behaviour like this.
Thanks for your ideas,
Markus