why unity crash?

I am using 2021.1.16f1, newest.

But when I play enter game mode, pretty high chance, unity just crashes.

Very stressful.

Why and how to resolve.

No ram reason, my laptop using 48G ram.

Look through the Unity editor log files, which will contain a crashdump which can give you a clue of at least which subsystem was involved in the crash. (post it here if you have trouble making sense of it)

1 Like

What Manta said, but realize that if you have an endless loop in your code, the logs probably won’t show anything.

// will appear to"crash" Unity 100% of the time,
// but it will actually be this code crashing:
while(true) ;      // DON'T DO THIS! CRASH!

[while] phrase in code always already have exit part. And not always crash because normally loop code don’t exist.

So just randomly unity crash, so don’t know why.

and I feel when my project exist on SSD drive, this crash occurs more frequently than located at HDD drive.

Has this grounds? I expected more speed, but it seems more unstable.

At other member’s desktop too, much crashes mainly when code revision and click unity for compile, or when click button that enter game mode.
He suffers quite more many than other member’s computers, why? Same cpu, same ram.

seems more frequently occurs than 2021.1.1f1 just before I used this.

When click enter mode, or after code revision, click unity compile, then very frequently (50%) unity crashes.

To avoid this, I recommend using only LTS versions. These are the more ‘stable’ ones.
In any case, without any code or context, it’s hard to tell what’s going wrong. StarManta and Kurt-Dekker already pointed you some directions. I haven’t crashed unity in weeks, I need to seriously mess up (like something that looks like Kurt’s example) to make it crash, and I’ve got 2/3 of your RAM.
Maybe update .NET, Mono or something? I couldn’t know.
If you’ve downloaded a project from somewhere else, you really should use the version that project was made in. One really can’t guarantee a project is stable in older/newer versions than the one the project was made with.

Unity crashes for me pretty frequently these days. Im using 2021.1.0f1 though.

I looked around and saw posts that recommended to delete the library folder in your project to let Unity rebuild it. I finally decided to do that today and have zero crashes since. Maybe back up your project before trying that?

Did library deleting, but after that, turn on project and it says over 40000 changes exist for publish.
But this is not acceptable because nothing changed, just deleted library folder.

Even after do [Discard all toggled changes], this does not disappears. Still it says there are 20000, 30000, 40000 changes exist.

This thread discusses what happens when deleting the library folders. I’m not using collab, so I don’t know what’s happening for you. When I deleted my library folders, Unity just rebuilds the folder the next time I start the project up.