I'm going to go out on a limb here with a somewhat radical answer:
Don't study for exams.
You are correct that cramming isn't very effective for retention. I don't think it's particularly effective for helping exam performance either, since cramming tends to a) deprive you of sleep and b) increase your stress level, both of which are terrible for doing well on an exam. Moving that cramming behavior earlier in time doesn't change things very much: you're still studying in a way that is stressful and doesn't promote long-term retention.
The best way to really learn the material in a course is to put it to use. Fortunately, most classes give you problem sets, projects, etc., that are designed to do just that. I recommend studying by embracing these wonderful gifts:
- Invest your time up front, working starting when problems or projects are given out, not at the last minute before they are due. The amount of time needed is the same, but your stress level will be lower and your retention higher.
- Remember that a problem is never really about getting the answer, it is about the process by which you get the answer. If you are just following a formula, you should feel uncomfortable, because what if you mix up the formula? Check your answers against intuitions and alternate routes to the solution to make sure that you are getting the process right.
- Don't give up on any problem. A difficult problem is a critical opportunity to learn key concepts in a class.
- If allowed, work together in groups---but make sure that you all do all of the problems individually before comparing. When you compare, arguing and explaining to figure out whose answer is correct will help you understand more thoroughly.
- When you get marks back, everywhere that you lost points make sure that you understand why and learn how to do it correctly.
- Also, go to class. Even if you don't like the lecturer, you are more likely to learn well from lecturer plus textbook than from textbook alone.
If you do all of this, there is little need to "study" in the cramming sense. By the time you walk into an exam, you will probably know quite well which parts of the material you know and which you don't. Instead of studying, I recommend taking the time before the exam period to relax, sleep well, and do interesting things that continue to exercise your intellect in whatever way you find most personally stimulating and inspiring.
Do all of this and you will likely be able to walk into an exam with low stress and a well-functioning brain, get the grade that you deserve, and retain the important material from the class over the long-term, to build on in your subsequent classes and your career.