Thanks for the answer, but it did not solve my problem.
2 and 3 , I already use logcat, but it dit not log anything about Garbage collection.
I finally use googlebreakpad to find the reason. It turns out that some team members forgot to write UPROPERTY() with a class member (let’s say A), so when the game running on mobile, the garbage collection collected A, and when somewhere use A again, game crashes.we use NewObject() method to dynamic create object, never use “new” operater in UE4,
Sorry for my poor English, I realize that code may show my case more clear.
class UMyObjManager : public UObject
{
..................
some code here
................
};
class AMyCharacter : public ACharacter
{
private:
class UMyObjManager* MyManager;
public:
class UMyObjectManager* GetManager()
{
if(MyManager == nullptr )
{
MyManager = NewObject<UMyObjManager >(this);
}
return MyManger;
}
};
I found that it crash because someone didn’t write UPROPERTY() on this line
class UMyObjManager* MyManager;
it should be
UPROPERTY()
class UMyObjManager* MyManager;
When I use UE 4.7.6, the editor will crash, and I can found the error easy. But When I Update the editor to UE 4.8.2, it is not crash anymore untile I launch my game on mobile. Why these editors behave different? There are so many people in our development team, we have to find out a way to prevent bugs like this happen again. Debugging a garbage collection crashes is very hard in UE4 now.
I notice that in UE4.8.1 hotfix, have a fix that:
UE-11816 [CrashReport] Garbage collection crashes not caused directly by the editor
What does it mean?
Do you have more easier way to debug something like garbage collection crash?
Thanks in advance.