{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/1778","labels_url":"https://api.github.com/repos/realm/realm-java/issues/1778/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/1778/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/1778/events","html_url":"https://github.com/realm/realm-java/issues/1778","id":116990541,"number":1778,"title":"ANR upon executing equalTo() hundreds of times inside a loop","user":{"login":"Saketme","id":2387680,"avatar_url":"https://avatars.githubusercontent.com/u/2387680?v=3","gravatar_id":"","url":"https://api.github.com/users/Saketme","html_url":"https://github.com/Saketme","followers_url":"https://api.github.com/users/Saketme/followers","following_url":"https://api.github.com/users/Saketme/following{/other_user}","gists_url":"https://api.github.com/users/Saketme/gists{/gist_id}","starred_url":"https://api.github.com/users/Saketme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Saketme/subscriptions","organizations_url":"https://api.github.com/users/Saketme/orgs","repos_url":"https://api.github.com/users/Saketme/repos","events_url":"https://api.github.com/users/Saketme/events{/privacy}","received_events_url":"https://api.github.com/users/Saketme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-15T12:35:26Z","updated_at":"2015-11-16T07:24:37Z","closed_at":null,"body":"Hello team, I'm noticing a strange behavior with Realm when calling `equalTo()` on a `RealmQuery` inside a loop where the app stops responding.\r\n\r\nThere's no stacktrace to debug this. I guess the crash is happening somewhere when `findAll()` is called on the query.\r\n\r\nI can email the sample project if you want."},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/156945467","html_url":"https://github.com/realm/realm-java/issues/1778#issuecomment-156945467","issue_url":"https://api.github.com/repos/realm/realm-java/issues/1778","id":156945467,"user":{"login":"cmelchior","id":406066,"avatar_url":"https://avatars.githubusercontent.com/u/406066?v=3","gravatar_id":"","url":"https://api.github.com/users/cmelchior","html_url":"https://github.com/cmelchior","followers_url":"https://api.github.com/users/cmelchior/followers","following_url":"https://api.github.com/users/cmelchior/following{/other_user}","gists_url":"https://api.github.com/users/cmelchior/gists{/gist_id}","starred_url":"https://api.github.com/users/cmelchior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmelchior/subscriptions","organizations_url":"https://api.github.com/users/cmelchior/orgs","repos_url":"https://api.github.com/users/cmelchior/repos","events_url":"https://api.github.com/users/cmelchior/events{/privacy}","received_events_url":"https://api.github.com/users/cmelchior/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T07:24:37Z","updated_at":"2015-11-16T07:24:37Z","body":"Chances are it is not crashing, but that the query is taking more than 5 seconds. 5 seconds is a very long time though, but calling `equalTo()` hundreds of times also sound pretty extreme. What is the use since you need to call it that many times?\r\n\r\nNote, you can use our new `findAllAsync` to prevent running the query on the UI thread, which should stop the ANR."}}