I have a Surface Pro 3 and have been running Opencpn 4.0, 4.2, 4.2.1 on it.
Your ini file looks normal to me and it appears the program exited cleanly even though you had Opencpn Hang, and then errors when shutting down the PC.
When I try to exit the OpenCPN program it hangs and on shutting the Surface PC down it shows 'Instruction 0x000000072DC20F failed on memory 0x000000000000000D4'
What version of Windows? Was the OS upgraded?
Try removing Opencpn and seeing if you still get the SP3 shutdown memory error.
Also try looking up in your Events
Manager more detail about the shutdown error.
This machine has 4gb of memory, but that should be adequate to run OpenCPN. What else is running? Try right click on the taskbar and select Task Manager, select "More Details" and then click on the Memory column, also check the Performance tab to see how much memory is being used. You should have plenty of memory left- but if you don't you are going to have to shutdown some startup programs, but I don't think the problem is this though.
If your machine OS was upgraded to Win10, or you just purchased it, you may want to be sure it is updated with current
drivers and possibly have MS tech support check the machine out to make sure it is working properly, configured right and has updated drivers. I would do this first.
Then try to install Opencpn again. It should install and run fine. It may help to know that it installs fine on my SP3. Then if you are still having trouble maybe Pavel or someone else has some thoughts...
PS: I was getting memory errors for various things, and had upgraded to Win10. MS Tech support was able to install a completely "fresh" version underneath my setup over a period of about 40 minutes (almost automatic) with no changes to my installations. That took care of some issues I was having. Haven't seen memory errors for awhile now. Your situation may be different.