A few years ago I was trying to reproduce a memory issue in a C++ app by sending it a ton of the same thing over and over again.. on my OS X laptop I couldn't reproduce the problem at all, until I had it send random data.
If you open "Activity Monitor" and look at the memory tab, it will show you a value for "Compressed"
see https://appleinsider.com/articles/13/06/13/compressed-memory... or similar for more info.