Posted By
RoePipi on 2020-09-18 11:41:49
| Re: How to detect a Garbage collecting operation?
I might have a method... Since I don't like when my programs freeze while an inevitable garbage collection happens, I issue a X=FRE(.) statement at every point of the code where a little (sub-second) delay is allowable, like after preparing the next level in a game, just before the main loop starts. However, I wanted to know how often garbage collection happens, so I did a little research and came up with this formula:
display free memory without garbage collection: ?PEEK(51)-PEEK(49)+256*(PEEK(52)-PEEK(50))
It tells you how many bytes left till the next garbage collection. Displaying this as debug info, you can estimate the remaining time it occurs next.
Hope I could help.
|