Trying to track down gref leak

Hi

I'm having problems with with an application reliably crashing after approximately 10 minutes of operation and I'm trying to track down the source of the crash.

The logcat seems to indicate that the crash is due to leaking of grefs based on the following line.

09-14 23:36:48.055 12383 12409 I monodroid-gc: 46080 outstanding GREFs. >Performing a full GC!

This line is followed by a frenzy of repeated GC activity until the application is terminated by the activity manager as shown in the following line following line.

08-23 11:10:14.393 880 894 I ActivityManager: Killing >1909:WheelchairQuickCollect.WheelchairQuickCollect/u0a220 (adj 0): user request >after error" (Note this line is from an earlier log - I just had it handy)

I've attempted to enable gref logging via the following adb command (as suggested by
https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/)

"adb shell setprop debug.mono.log gref,gc"
However I'm having two problems with logging

1) the log entries don't seem to contain any useful information below is an example of the gref logs. Note that there isn't any stack trace or type information on the objects the grefs point to as is shown in the troubleshooting example on the Xamarin website.

2) Enabling the gref log causes the main ui of my app to freeze. I have replicated this behavior several times but haven't been able to figure out why this is the case. I dont get any uncaught exceptions in the ide, just frozen screen followed by the activity manager force finishing my main activity
(09-14 23:45:30.742 883 909 W ActivityManager: Force finishing activity WheelchairQuickCollect.WheelchairQuickCollect/md580d5d820f0b3cedc88e4799f6dbbf8c>5.MainActivity
)

Anyone have any suggestions on how I might identify what is locking up the UI thread?

Also any thoughts on how can I determine what is using up all of the grefs woudl be greatly appreciated. Even type information for the .net runtime or java objects linked by these refs would be a good start.

Thanks,

John


09-14 23:45:30.389 13759 14047 I monodroid-gref: +w+ grefc 1082 gwrefc 4 obj-handle 0x1018c6/G -> new-handle 0x2002d7/W from thread 'finalizer'(14047)

09-14 23:45:30.389 13759 14047 I monodroid-gref: -g- grefc 1082 gwrefc 4 handle 0x1018c6/G from thread 'finalizer'(14047)

09-14 23:45:30.389 13759 14047 I monodroid-gref: +w+ grefc 1081 gwrefc 5 obj-handle 0x1018f6/G -> new-handle 0x2002db/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1081 gwrefc 5 handle 0x1018f6/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1080 gwrefc 6 obj-handle 0x1018ba/G -> new-handle 0x2002df/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1080 gwrefc 6 handle 0x1018ba/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1079 gwrefc 7 obj-handle 0x101916/G -> new-handle 0x2002e3/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1079 gwrefc 7 handle 0x101916/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1078 gwrefc 8 obj-handle 0x18f2/G -> new-handle 0x2002e7/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1078 gwrefc 8 handle 0x18f2/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1077 gwrefc 9 obj-handle 0x201426/G -> new-handle 0x2eb/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1077 gwrefc 9 handle 0x201426/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1076 gwrefc 10 obj-handle 0x2018fa/G -> new-handle 0x2002ef/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1076 gwrefc 10 handle 0x2018fa/G from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: +w+ grefc 1075 gwrefc 11 obj-handle 0x18ea/G -> new-handle 0x2f3/W from thread 'finalizer'(14047)

09-14 23:45:30.390 13759 14047 I monodroid-gref: -g- grefc 1075 gwrefc 11 handle 0x18ea/G from thread 'finalizer'(14047)

Sign In or Register to comment.