At first glance I would suspect #L176 being called on every lock and then setting a new timeout without clearing the old one. It should be a fairly tiny memory leak if this is the reason, the timeout only can accumulate over 45 seconds.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
At first glance I would suspect #L176 being called on every lock and then setting a new timeout without clearing the old one. It should be a fairly tiny memory leak if this is the reason, the timeout only can accumulate over 45 seconds.