From the command line (Terminal.app), you can run the following command:
/usr/sbin/system_profiler SPHardwareDataType | grep Memory:
The resulting output will look like this:
# /usr/sbin/system_profiler SPHardwareDataType | grep Memory:
Memory: 8 GB