我认为这与记忆有关,但我已经做了我能想到的一切。我已经确保类是处置财产。在类级别而不是函数范围内维护硬引用,用于在我使用它们时可能会被 GC 处理的东西等。
基本上,该应用程序在模拟器中运行良好,但在真实设备上的同一位置崩溃。似乎我得到了几个不同的堆栈,但它们都在同一个地方。
我在我的应用程序中使用了大量的事件。线程太多?
堆栈跟踪:
在 Newtonsoft.Json.JsonWriter.WriteValue (object) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json。 Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteMemberInfoProperty (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject ( Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonObjectContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter。在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter.SerializeList (Newtonsoft.Json.JsonWriter) ,Newtonsoft.Json.Utilities.IWrappedCollection,Newtonsoft.Json.Serialization.JsonArrayContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter,对象,Newtonsoft.Json.Serialization.JsonContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteMemberInfoProperty (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonObjectContract,Newtonsoft.Json.Serialization.JsonProperty ,Newtonsoft.Json.Serialization.JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization. JsonContract) 在 Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter,object) 在 Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter,object) 在 Newtonsoft.Json.JsonSerializer。在 RestSharp 的 /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/Serializers/JsonSerializer.cs:64 中的 RestSharp.Serializers.JsonSerializer.Serialize (object) [0x0001c] 序列化 (Newtonsoft.Json.JsonWriter,object)。 RestRequest.AddBody (object,string) [0x00019] in /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:203 at RestSharp.RestRequest.AddBody (object) [0x00000] in /Users/sonmez56/ Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:232 在 TrackAboutMonoCore.Services.TrackAboutAPIRequestBuilder/TARESTRequest.WithBody (T) <0x00097> 在 TrackAboutMonoCore.Services.ActionsService.CustomerSetVolume (int,System.Collections.Generic.List在 /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/Serializers/JsonSerializer.cs:64 在 /Users/sonmez56/ 中的 RestSharp.RestRequest.AddBody (object,string) [0x00019] 中序列化(对象)[0x0001c] Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:203 at RestSharp.RestRequest.AddBody (object) [0x00000] in /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:232 at TrackAboutMonoCore .Services.TrackAboutAPIRequestBuilder/TARESTRequest.WithBody (T) <0x00097> 在 TrackAboutMonoCore.Services.ActionsService.CustomerSetVolume (int,System.Collections.Generic.List在 /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/Serializers/JsonSerializer.cs:64 在 /Users/sonmez56/ 中的 RestSharp.RestRequest.AddBody (object,string) [0x00019] 中序列化(对象)[0x0001c] Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:203 at RestSharp.RestRequest.AddBody (object) [0x00000] in /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:232 at TrackAboutMonoCore .Services.TrackAboutAPIRequestBuilder/TARESTRequest.WithBody (T) <0x00097> 在 TrackAboutMonoCore.Services.ActionsService.CustomerSetVolume (int,System.Collections.Generic.ListRestRequest.AddBody (object) [0x00000] in /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:232 at TrackAboutMonoCore.Services.TrackAboutAPIRequestBuilder/TARestRequest.WithBody (T) <0x00097> at TrackAboutMonoCore.Services .ActionsService.CustomerSetVolume (int,System.Collections.Generic.ListRestRequest.AddBody (object) [0x00000] in /Users/sonmez56/Projects/TrackAbout.Mono/RestSharp/RestSharp/RestRequest.cs:232 at TrackAboutMonoCore.Services.TrackAboutAPIRequestBuilder/TARestRequest.WithBody (T) <0x00097> at TrackAboutMonoCore.Services .ActionsService.CustomerSetVolume (int,System.Collections.Generic.List
1<TrackAboutMonoCore.Models.Asset>,System.Action
1>) [0x00000] 在 /Users/sonmez56/Projects/TrackAbout.Mono/TrackAboutMonoCore/Services/ActionsService.cs:24 在 TrackAboutMonoCore.Controllers.LocateController.Save (object,System.EventArgs) [0x00055] 在 /Users/sonmez56 /Projects/TrackAbout.Mono/TrackAboutMonoCore/Controllers/LocateController.cs:64 在 MonoTouch.UIKit.UIBarButtonItem/Callback.Call (MonoTouch.Foundation.NSObject) [0x00010] 在 /Developer/MonoTouch/Source/monotouch/src/UIKit/ UIBarButtonItem.cs:23 at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff> 在 MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer /MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 在 /Users/sonmez56/Projects/TrackAbout 中的 TrackAboutIOS.Application.Main (string[]) [0x00000]。Mono/TrackAboutIOS/TrackAboutIOS/Main.cs:16 at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>本机堆栈跟踪:
0 TrackAboutIOS 0x01d20618 mono_handle_native_sigsegv + 280 1 TrackAboutIOS
0x01d45bd4 sigabrt_signal_handler + 180 2 libsystem_c.dylib
0x376647ed _sigtramp + 48 3 libsystem_c.dylib
0x3765a20f pthread_kill + 54 4 libsystem_c.dylib
0x3765329f abort + 94 5 TrackAboutIOS
0x01e394ac monoeg_g_log + 208 6 TrackAboutIOS
0x01d11664 get_numerous_trampoline + 160 7 TrackAboutIOS
0x01d11aac mono_aot_get_imt_thunk + 56 8 TrackAboutIOS
0x01dbdc50 initialize_imt_slot + 112 9 TrackAboutIOS
0x01dbf1c4 build_imt_slots + 1124 10 TrackAboutIOS
0x01dbf32c mono_vtable_build_imt_slot IOS + 120 1
0x01d236fc mono_convert_imt_slot_to_vtable_slot + 292 12 TrackAboutIOS 0x01d23974 common_call_trampoline + 284 13 TrackAboutIOS 0x01d21c60 mono_vcall_trampoline + 228 14 TrackAboutIOS
0x00934198 generic_trampoline
0x00b9fec4 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeValue_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1116 16 TrackAboutIOS 0x00ba13bc Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_WriteMemberInfoProperty_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1712 17 TrackAboutIOS 0x00ba2a70 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeObject_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonObjectContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1784 18 TrackAboutIOS0x00ba0124 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeValue_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1724 19 TrackAboutIOS 0x00ba3ec0 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeList_Newtonsoft_Json_JsonWriter_Newtonsoft_Json_Utilities_IWrappedCollection_Newtonsoft_Json_Serialization_JsonArrayContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 2520 20 TrackAboutIOS 0x00ba041cNewtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeValue_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 2484 21 TrackAboutIOS 0x00ba13bc Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_WriteMemberInfoProperty_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1712 22 TrackAboutIOS 0x00ba2a70 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeObject_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonObjectContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1784 23 TrackAboutIOS0x00ba0124 Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_SerializeValue_Newtonsoft_Json_JsonWriter_object_Newtonsoft_Json_Serialization_JsonContract_Newtonsoft_Json_Serialization_JsonProperty_Newtonsoft_Json_Serialization_JsonContract + 1724 24 TrackAboutIOS 0x00b9f70c Newtonsoft_Json_Serialization_JsonSerializerInternalWriter_Serialize_Newtonsoft_Json_JsonWriter_object + 356 25 TrackAboutIOS 0x00b2c52c Newtonsoft_Json_JsonSerializer_SerializeInternal_Newtonsoft_Json_JsonWriter_object + 300 26 TrackAboutIOS 0x00b2c3b4 Newtonsoft_Json_JsonSerializer_Serialize_Newtonsoft_Json_JsonWriter_object + 156 27 TrackAboutIOS 0x012010c0 RestSharp_Serializers_JsonSerializer_Serialize_object + 452 28 TrackAboutIOS0x011f8ad0 RestSharp_RestRequest_AddBody_object_string + 396 29 TrackAboutIOS
0x011f8e4c RestSharp_RestRequest_AddBody_object + 152 30 TrackAboutIOS 0x011d3c64 TrackAboutMonoCore_Services_TrackAboutAPIRequestBuilder_TARestRequest_WithBody_T_T + 152 31 TrackAboutIOS 0x011d22d4 TrackAboutMonoCore_Services_ActionsService_CustomerSetVolume_int_System_Collections_Generic_List_1_TrackAboutMonoCore_Models_Asset_System_Action_1_RestSharp_RestResponse_1_TrackAbout_Rest_Models_TARestResponse + 328 32 TrackAboutIOS 0x011ce3bc TrackAboutMonoCore_Controllers_LocateController_Save_object_System_EventArgs + 960 33 TrackAboutIOS 0x0139003c MonoTouch_UIKit_UIBarButtonItem_Callback_Call_MonoTouch_Foundation_NSObject + 96 34 TrackAboutIOS 0x008b0450wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200 35 TrackAboutIOS 0x01d05834 mono_jit_runtime_invoke + 1644 36 TrackAboutIOS
0x01dbd09c mono_runtime_invoke + 128 37 TrackAboutIOS
0x01e4c054 monotouch_trampoline + 3436 38 CoreFoundation
0x30c7f3fd -[NSObject performSelector:withObject:withObject:] + 52 39 UIKit 0x3353efaf -[UIApplication sendAction:to:from:forEvent:] + 62 40 UIKit
0x3360476b -[UIBarButtonItem(UIInternal ) _sendAction:withEvent:] + 118 41 CoreFoundation 0x30c7f3fd -[NSObject performSelector:withObject:withObject:] + 52 42 UIKit
0x3353efaf -[UIApplication sendAction:to:from:forEvent:] + 62 43 UIKit 0x3353ef6b -[UIApplication sendAction:toTarget: fromSender:forEvent:] + 30 44 UIKit
0x3353ef49 -[UIControl sendAction:to:forEvent:] + 44 45 UIKit
0x3353ecb9 -[UIControl(内部) _sendActionsForEvents:withEvent:] + 492 46 UIKit 0x3353f5f1 -[UIControl touchesEnded:withEvent:] + 476 47 UIKit
0x3353dad3 -[UIWindow _sendTouchesForEvent:] + 318 48 UIKit
0x3353d4c1 -[49UI 窗口发送事件UIKit
0x3352383d -[UIApplication sendEvent:] + 356 50 UIKit
0x335230e3 _UIApplicationHandleEvent + 5826 51 GraphicsServices
0x33e1322b PurpleEventCallback + 882 52 CoreFoundation
0x30cf9523 CFRUNLOOP_IS_CALLING_OUT_TO_A3_SOURCE1_PERFORM_UNCTION + 5826 51 CoreFoundation 0x30cf9523 CFRUNLOOP_IS_CALLING_OUT_TO_A3_SOURCE1_PERFORM_UNCTIONCFRunLoopDoSource1 + 140 54 CoreFoundation 0x30cf8313 __CFRunLoopRun + 1370 55 CoreFoundation
0x30c7b4a5 CFRunLoopRunSpecific + 300 56 CoreFoundation
0x30c7b36d CFRunLoopRunInMode + 104 57 GraphicsServices
0x33e12439 GSEventRunModal + 136 58 UIKit
0x33551e7d UIApplicationMain + 1080 59 TrackAboutIOS
0x01696c74 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string _intptr_intptr + 240 60 TrackAboutIOS 0x00098420 TrackAboutIOS_Application_Main_string__ + 152 61 TrackAboutIOS
0x008b0450 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200 62 TrackAboutIOS 0x01d05834 mono_jit_runtime_invoke + 1644 63 TrackAboutIOS
0x01dbd09c mono_runtime_invoke + 128 64 TrackAboutIOS
0x01dc16b4 mono_runtime_exec_main + 436 65 TrackAboutIOS
0x01dc1a74 mono_runtime_run_main + 756 66 TrackAboutIOS
0x01d0c744 mono_jit_exec + 140 67 TrackAboutIOS
0x01e41110 main + 2288 68 TrackAboutIOS
0x0009826c start + 52