Skip to content

Commit

Permalink
fixed Caused by java.lang.OutOfMemoryError
Browse files Browse the repository at this point in the history
      Failed to allocate a 59953368 byte allocation with 16777216 free bytes and 17MB until OOM
      java.lang.StringFactory.newStringFromChars (StringFactory.java:218)
      arrow_right
      com.jecelyin.editor.v2.io.FileReader.read (Unknown Source)
      com.jecelyin.editor.v2.editor.Document$ReadFileTask.doInBackground (Unknown Source)
      com.jecelyin.editor.v2.editor.Document$ReadFileTask.doInBackground (Unknown Source)
      android.os.AsyncTask$2.call (AsyncTask.java)
      arrow_drop_down
      java.lang.Thread.run (Thread.java)
  • Loading branch information
tranleduy2000 committed Jun 7, 2018
1 parent 6ff1cf7 commit 9f87398
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void onStart() {

@Override
public SpannableStringBuilder onAsyncReaded(FileReader fileReader, boolean ok) {
Editable text = fileReader.getBuffer();
CharSequence text = fileReader.getBuffer();
String firstLine = text.subSequence(0, Math.min(80, text.length())).toString();

ModeProvider modeProvider = ModeProvider.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public boolean read() {
} catch (Exception e) {
DLog.e(e);
return false;
} catch (OutOfMemoryError error) {
return false;
}
}

Expand Down

0 comments on commit 9f87398

Please sign in to comment.