Open ditproz opened 6 years ago
@ditproz thanks for this report. The regular timer is expected, it checks cookies to make sure the user's account is still signed in. However, the constant heap increase seems suspicious. We'll investigate.
Any ideas why this might occur?
@ditproz did you find a resolution to this? I seem to be having a similar issue in my own app in React
I'm review my code because I have found a memory leak. I'm building a single page app on Angular 2. I'm using the GAPI library @ https://apis.google.com/js/api.js
I have stripped my code back to the bones and have added line by line and function by function to find the issue. Our system uses the GAPI library to login via OAuth and maintain the login status on our app.
It appears as if the gapi.client.init, when included in the code causes a leak in the app. If you review the image, you will see a steady climb of JS objects and at the bottom a repeated call to function
Timer Fired
which I believe is the setTimeout function. Is this expected behaviour?The code in question which seems to cause the behaviour:
We're able to authenticate with Google via Oauth successfully and the whole app works etc...
Is there a special way to initialise this library on a one page app? What have I done wrong?
I'm testing the app in Chrome Version 62.0.3202.94 (Official Build) (64-bit) Windows 10 64 bit Angular: angular2 2.0.0-beta.21