In a cloud provider situation there is no pure software solution to this, the hypervisor can always dump your memory pages / register states