If it's a compaq it should have build in tests in the bios setup (i think f10 screen at startup for compaq)
Go to Diagnostic tab >You should see a memory test. Run it.
There are other utilities that can help also. If U have two sticks of ram and the compaq is a laptop, then U can try by trial and error(remove one and start your PC, then do the same with the second) If you haven't done this before, be carefull how U hold it and remember there is a certain angle to place it back in and U should hear a click.
(Also, if your computer show less ram, it might be because of the video card. That's ok.)