i have a list of simples pojos (a User class) with about 15 simple fields & 1 arrayList.
Those represent users & maybe 100 or 1000 of them will be store in memory in order to avoid to retrieve them from external system every time. (i’m using Ehcache)
I would like to know with a junit test how much memory is used by a list of K of those users.
I have the intuition that simple pojo like those one even for a 1000 ones are not threatening in any way (in other words less than 100 Ko)
Thanks in advance for your anwser.
i really appreciate your help.
You can calculate the memory used by the JRE before and after you create your object, in order to approximate how many bytes are being used by your object.