You should find the max speed of both independently, and the set the best combination to max out both.
Find max CPU by using the biggest divider on the RAM (ie 100Mhz or 2:1 depending on BIOS) and raising FSB/HTT, raising vcore etc so you can OVC the CPU without the RAM being OC'd.
The find the max RAM by lowering the CPU multi (6 0or 7 for example), putting the divider back to 1:1 and raising FSB/HTT and vdimm, adjusting timings etc, until you find max RAM, this should leave the CPU from being overclocked.
The you use the multi, divider etc that puts both at their max stable speeds.