JavaScript getting slow after running idle for 10Hr+ [closed]

I have a custom JavaScript library that I need to use in my Java project. To achieve this, I wrapped the JavaScript library with React Native and created a bridge to access its functions.

Initially, everything works fine. However, after the application runs for more than 10 hours, the JavaScript library starts responding with delays. For instance, an API call that usually returns within 700ms takes 2 to 3 seconds after running for 10 hours.

Note: During the 10-hour idle period, no API calls are made. For API requests, I’m using Axios.

JAVA <-> RN <-> JS Library