I am currently working on a 2D java game which utilizes a linkedhashmap for rendering data at a particular tile. When I serialize the class object which contains this as well as a few other non transient objects used for map rendering the file which is output only has a size of 4kb. To my understanding RAM usage depends upon the size of whatever is being read from, but apparently I am using up a max of 20% of my memory reading from a file that is less than 4kb in size. This leads me to believe that my understanding of how RAM works is wrong or I am missing something that is giving me bad RAM readings.
Method of RAM Analysis
usedPercent = (double) (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Runtime.getRuntime().maxMemory();