Compliance current controlled volatile and nonvolatile memory in Ag/CoFe2O4/Pt resistive switching device