Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on RxBleInternalScanResult for long scanning period #194

Closed
lukevr opened this issue May 17, 2017 · 1 comment
Closed

Memory leak on RxBleInternalScanResult for long scanning period #194

lukevr opened this issue May 17, 2017 · 1 comment
Assignees
Labels
bug Bug that is caused by the library
Milestone

Comments

@lukevr
Copy link

lukevr commented May 17, 2017

Summary


Objects RxBleInternalScanResult are not collected by GC, in case when phone scans for a long time. The speed of scanning(e.g. passing rxBleScanResult to subscriber) goes down dramatically.

Preconditions


Long lastScanTime = 0;

Subscription scanSubscription = rxBleClient.scanBleDevices()
.subscribe(
rxBleScanResult -> {
// Process scan result here.
long currTime = currentTimeMillis();
Log.i(TAG, "Delay between results: " + (currTime - lastScanTime));
lastScanTime = currTime;
},
throwable -> {
// Handle an error here.
}
);

Steps to reproduce actual result

  1. 3-5 BLE services should advertise in one room, Run App, keep Activity active.
  2. See unexpected "Delay between results" after 15-20 min in Logcat
  3. See continues growing of RxBleInternalScanResult objects in Dumped Java Heaps

Actual result


The amount of RxBleInternalScanResult keeps growing, the performance of scanning goes down.

Expected result


GC collects old RxBleInternalScanResult, the performance of scanning is stable.

@dariuszseweryn dariuszseweryn self-assigned this May 17, 2017
@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label May 17, 2017
@dariuszseweryn dariuszseweryn modified the milestones: 1.3.0, 1.2.3 May 18, 2017
@dariuszseweryn
Copy link
Owner

Fixed with b53d840
Should be available in 1.2.3-SNAPSHOT shortly and in 1.2.3 later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

2 participants