I created a background service that would ask every other server if there is any new data using the debug monitor which I saw It is that allocated memory is increasing and increases until it says no memory leak.
index.js
var Intent = Titanium. Android.createServiceIntent ({url: 'service.js'}); Intent.putExtra ('Interval', 1000); // Millisecond Titanium is required. Android Start service (intent);
service.js
var url = "localhost: 8051"; Ti.API.info ("Checkoffer Notification:" + URL); Var xhr = Ti.Network.createHTTPClient ({onload: function (e) {Ti.API.info ('Onload call, HTTP status =' + this.status);}, panic: function (e) {Ti.API information ('Error, HTTP status =' + this.status);}, timeout: 5000 / * in millisecond *}}; Xhr.open ('GET', URL); Xhr.send ();
I have yet realized what is the mistake of xhr.send (), it is not clear or maybe it is doing something wrong to me. Any suggestion that this memory leak How to Avoid?
The request timeout is 5 seconds and loop time is 1 second ... then it is clear that this is very Will send more calls, whether it comes with its feedback or not even 5 seconds before or no, comes before. So it is better to keep track of calls and manually issue XHR variables. Or you can do this by repeating it in another way, this means that when you receive a call response for the first time, then call again.
Comments
Post a Comment