There is a code for the calculator program, you need to find out how much memory it uses at startup. I saw this answer:
long usedBytes = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); But what it is and where it is, I can not imagine.