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

fixing ANR on large files #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alexcohn
Copy link

@alexcohn alexcohn commented Aug 7, 2019

see https://stackoverflow.com/q/57067507/192373

  1. use StringBuilder to accumulate the output text
  2. convert it to String inside doInBackground, not on Main thread

see https://stackoverflow.com/q/57067507/192373

1) use StringBuilder to accumulate the output text
2) convert it to String inside doInBackground, not on Main thread
@alexcohn
Copy link
Author

alexcohn commented Aug 7, 2019

Actually, I don't think it's always necessary to aggregate all intermediate output lines into one huge output string. In the case the output is short, and especially if onProgress() is empty, it may be OK. But for big files, this puts too much stress on the Garbage Collector, and the info is available anyways, timely: in the overridden ExecuteBinaryResponseHandler.onProgress() callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant