-
Notifications
You must be signed in to change notification settings - Fork 74
OutOfMemoryError #31
Comments
Could you provide sample code? |
Wasn't able to reproduce it in your sample project so far. But maybe I have not tried long enough, because the error appears only after a few minutes. Can tell more tomorrow and may add some sample code. |
Hi Andriy, But there are some other differences in my app. I use your library inside a singleton controller class which gets provided by dagger. I also use a PublishSubject from RxJava2 to forward the bonjourService results to RxJava2 chain. Doublechecked everything and can't find a leak or something which could cause the OutOfMemoryError. Btw: Is there a reason why you undeprecated the embedded version? I tried it but it takes more time to find devices after start browsing. PS: Any news on #30? :) |
It looks like your Rx chain has a lot uncompleted operation: hundreds or thousands. In your case you should always has only 1 long running You should definitely use DNSSDBindable, embedded version is only for old devices before 4.1 or some buggy Samsung with (4.4.2) and I'm not sure should I support this in 2017. Also your bug looks like one that not depends on embedded or bindable realization of DNSSD #30 - fixed |
Thanks!! I'm also starting to believe the issue is not caused by anything from your implementation. Will see if I can dive in some deeper by logging the running operations. |
Hello. I'm seeing this occasionally, too. The stack trace is nearly identical to the one at the top of this thread. When this crash occurs, there are over 1000 threads with the same stack trace:
Here are the crash details: http://crashes.to/s/4411a5e5655 Here's my code where I'm setting up RxDNSSD: private void startSourceDiscovery() {
if (rxDnssd == null)
rxDnssd = new RxDnssdBindable(this);
rxDnssd.browse(HEAR_TV_SERVICE_TYPE, "local.")
.compose(rxDnssd.resolve())
.compose(rxDnssd.queryRecords())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<BonjourService>() {
@Override
public void call(BonjourService bonjourService) {
if (!bonjourService.isLost()) {
serviceResolved(bonjourService);
} else {
serviceRemoved(bonjourService);
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
Log.e("hearTVservice", "DNSSD Error: ", throwable);
}
});
}
private void stopSourceDiscovery() {
rxDnssd = null;
}
public void refreshSourceList() {
stopSourceDiscovery();
sourceListClear();
startSourceDiscovery();
} I'm wondering if I shouldn't be setting |
Hi @namannik
No, it's not necessary |
Thanks. I've been using 0.9.1. I'll try to 0.9.5 to see if this resolves the issue. Side note: As recommended by @G00fY2 here, in order to upgrade from 0.9.1 to 0.9.5, I had to change my dependencies to:
|
Hi, I finally investigated this issue and found that leak of threads might occured because of hang of some Check out new version https://github.com/andriydruk/RxDNSSD/releases/tag/0.9.7 |
Thanks for the update. I'll check it out next time I have a chance. |
Like I wrote yesterday, I updated RxDNSSD to 0.9.3 (mainly because I hoped the following issue may been fixed) but I still get this error after a while and my app freezes. Normally this error appears when I do nothing within the app. Seems like it occurs in some background progress.
Maybe you have an idea?
The text was updated successfully, but these errors were encountered: