Hi
In safe mode many Windows elements and actions are turned off, reducing the need for memory usage.
Do you have another PC that only has 4 Gigabytes of ram, that doesn't crash?
Almost all new PCs come with 8 Gigabytes or more now.
4 Gigs isn't enough to run Windows 10 unless you aren't using it for more than the most basic activities.
And it can depend on how your other hardware is configured and what it is as well.
If you don't have a video card and are using the video from the mother board for instance you are doing all the video processing with the ram you have on the card.
Most video cards now have more than 4 Gigabytes of ram by themselves now, reducing the load on the onboard ram.
Mike