But it’s just about impossible to prevent secrets from being written to memory—presumably, your program needs access to the data at some point.
Chess, Brian and Jacob West. “Secure Programming with Static Analysis”. Addison-Wesley. 2007.