What are primitive values in programming, and how do they differ from object-based references in memory allocation?