As a guy who has been very lucky to experience virtually ZERO crashes or freezes using SONAR , I have always followed the #1 basic rule of Pro Recording Studios ....
If you can afford it, your Studio DAW PC should be a dedicated system...
1) No internet access
2) No Antivirus programs
3) Minimal other software applications installed
4) No Windows O/S once you have a rock solid system
Any updates or patches can be downloaded and virus scanned on a separate work computer and transferred to the dedicated Audio DAW PC.
In other words, your DAW PC is 100% dedicated on recording and nothing else.
Use a laptop or other PC for all your web browsing, saving photos, WORD, EXCEL, WI-FI, webcams, graphic utilities, etc.....
This is the most sure way of avoiding glitchy conflicts in a DAW environment