Just some general advice to anyone looking for help. If you actually want somebody to help you, then you need to show the problem you have. Just saying "I run out of memory" doesn't give us much to go on; we don't want to waste our time listing anything and everything that might cause the problem when simply showing the project file could narrow it down. The basic act of including the scene file you have and telling us the steps you take to make the problem will allow someone else to work out what is going wrong.
And yes, it may be "just a cube and some subdivisions", but the scene file will include all sorts of other project settings; and what you consider to be a normal setting might turn out to be the problem.