That error suggests a problem with the amount of memory available. Did you use the PostgreSQL tuning option offered by PT4 recently? If so, please try undoing that via Database > Database Management > Housekeeping > Revert PostgreSQL Tuning, and see if that allows the update to complete.
To do that, you'll need to reject the offer to update your databases. Revert the tuning and then restart - it should offer to update your databases again. Don't try to do anything else in v4.01.18 without updating the databases or it could cause problems.
If that does work, once the update has completed please restart PT4 and apply the PostgreSQL tuning again (in the same way you reverted it) and then attach the PokerTracker4.log file from C:\Users\yourname\AppData\Local\PokerTracker 4\ (which you can access from the PT4 File menu) to a
Support Ticket so that we can see what your system settings are and see if the tuning rules need to be adjusted for setups like yours.