thomasokken / free42

Free42 : An HP-42S Calculator Simulator
https://thomasokken.com/free42/
GNU General Public License v2.0
280 stars 54 forks source link

MEM returns a decreasing count of available memory #56

Closed albrro closed 1 year ago

albrro commented 1 year ago

Plus42 1.0.19 on Android 11

Repeatedly calling MEM results in available memory decreasing. There are no programs or any other user activity that could account for memory consumption.

thomasokken commented 1 year ago

In the Android version, MEM simply shows the value returned by Runtime.freeMemory(). If this value slowly decreases when MEM is pressed several times in a row, it's probably because of temporary objects being allocated by the OS when it dispatches the tap events on the display. The value should go back up eventually when the garbage collector runs.

I can't be any more specific since I don't know exactly what Android does behind the scenes. I do know it's not an issue with Free42; the app itself does not leak memory when handling MEM.