GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 本地txt打开会出现OutOfMemoryError · Issue #26 · newbiechen1024/NovelReader

本地txt打开会出现OutOfMemoryError #26

New issue
Copy link
New issue
Copy link
Closed
Closed
本地txt打开会出现OutOfMemoryError#26
Copy link

Description

@eric0815
eric0815
opened on Jan 6, 2018
Issue body actions

操作步骤,清理后台,打开IReader,载入一个本地txt文件,从书架打开,返回书架,再点击任意一个txt都会黑屏
后台报错信息:

01-06 22:47:20.552 2040-2059/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 5.419s for cause Background
01-06 22:47:20.552 2040-2040/com.example.newbiechen.ireader I/art: Waiting for a blocking GC Alloc
01-06 22:47:20.552 2040-2132/com.example.newbiechen.ireader I/art: Waiting for a blocking GC Alloc
01-06 22:47:20.577 2040-2040/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 875.902ms for cause Alloc
01-06 22:47:20.577 2040-2040/com.example.newbiechen.ireader I/art: Starting a blocking GC Alloc
01-06 22:47:20.578 2040-2132/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 328.382ms for cause Alloc
01-06 22:47:20.578 2040-2132/com.example.newbiechen.ireader I/art: Starting a blocking GC Alloc
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:111)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Looper.loop(Looper.java:159)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6363)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at java.lang.reflect.Method.invoke(Native Method)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: Caused by: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.newbiechen.ireader, PID: 2040
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:111)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:159)
at android.app.ActivityThread.main(ActivityThread.java:6363)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
Caused by: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
01-06 22:47:20.590 2040-2040/com.example.newbiechen.ireader I/Process: killProcess pid=2040
java.lang.RuntimeException
at android.os.Process.killProcess(Process.java:1258)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:111)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
at io.reactivex.plugins.RxJavaPlugins.uncaught(RxJavaPlugins.java:288)
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:282)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:113)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:159)
at android.app.ActivityThread.main(ActivityThread.java:6363)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
01-06 22:47:20.590 2040-2040/com.example.newbiechen.ireader I/Process: Sending signal. PID: 2040 SIG: 9

Activity

  1. newbiechen1024 commented on Jan 14, 2018

    @newbiechen1024
    newbiechen1024
    on Jan 14, 2018
    Owner
    More actions

    阅读界面 OOM 崩溃的原因是这样的:

    1. 我是通过使用 PageView@onSizeChanged() 来获取当前屏幕的大小的。
    2. 在解析文本,加载章节的代码中,具体在 PageLoader@loadPages() 中,会根据 mVisibleHeght 即当前屏幕的高度,进行加载章节。
    3. 某些情况下 loadPages() 会在 onSizeChanged() 完成之前执行,导致获取到的 height 一直为 0 ,导致 loadPagess() 中 while 循环一直进行不会退出。

    结论就是 onSizeChanged() 是异步执行,转换成同步回调的。

    Reacted by zhangchengtest, dayfan0810, BayarHwasaii, xy.gao, Kqlandroid, ZQ7, wlwoon, Serendipity, HelloZoe, qiaoscong and 1 more
    Reacted by subfire
  2. newbiechen1024
    closed this as completedon Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.