cycles isnt working when rendering
You have two problems:

The first one is that you have set the subsurf modifier to a very high number of subdivisions for rendering.



You have to be careful when using the subsurf modifier, as it increases the number of vertices exponentially. Using a large number of vertices will require more RAM and will use more computing resources.
I doubt you need 6 levels of subdivision ever. With 6 levels of subdivision your very simple scene needs 6.5GB of RAM to render.

Use a more reasonable number. Read: Blender render crash when using subsurf modifiers.

The second problem is that you are trying to use depth of field on the camera, but have set the focus distance to zero, so your scene is completely out of focus, and it renders all gray.


Set the focus  to the distance of the object , or select the object as your focus target.



Read: 

Rendered image is just grey