The invention provides a silicon oxycarbide film and an RRAM (resistive random access memory). The molecular formula of a silicon oxycarbide film resistive material is SiCxOy, wherein x is from 1.21 to 0.21, y is from 1.45 to 2.01, and x and y are in negative correlation. The thickness of the film is 50nm or less. The RRAM comprises a top electrode, a resistive dielectric layer, a substrate and a back electrode, and is characterized in that the resistive dielectric layer is the silicon oxycarbide film. The top electrode is made of Ag and Al. The RRAM is prepared by a material compatible with the COMS technology, and physical deposition film equipment is mainly used in a preparation process. No high-temperature technology is employed, and the consumption of energy is reduced. Silicon oxycarbide films with different defect concentrations can be obtained through the control of gas proportion. For an SiC0.202.01 material, the switch ratio reaches 500, and can completely meet the actual demands (the switch ratio is greater than 10). Meanwhile, the RRAM based on the silicon oxycarbide material has a self-rectification effect, thereby simplifying the design of an external circuit.