Which iMac do you have? the 24" from early 2008 with 3.06GHz or the 24" from early 2009 with 3.06GHz?
I ask because the 2008 Model has DDR2 RAM, and supports a maximum of 6GB. The 2009 Model has DDR3 RAM and Supports up to 8GB!
If you not sure which model you have, just check if you have DDR2 or DDR3 RAM in your system profiler check the model identifier.
2008 Model: iMac8,1
2009 Model: iMac9,1