Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #10432 Reply

    Saab

    This happens when a PDF is being viewed and the recents button is repeatedly tapped until this exception occurs.
    Visually the recents screen shows the last state of the application, however with the recents view for our application the PDF starts to cascade.

    Here is the stack trace.

    10-16 09:52:42.559 8633-8633/<Our package name> E/art: Throwing OutOfMemoryError “Failed to allocate a 16281612 byte allocation with 14178776 free bytes and 13MB until OOM”
    10-16 09:52:42.559 8633-8633/<Our package name> D/AndroidRuntime: Shutting down VM
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: FATAL EXCEPTION: main
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: Process: <Our package name>, PID: 8633
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 16281612 byte allocation with 14178776 free bytes and 13MB until OOM
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.graphics.Bitmap.nativeCreate(Native Method)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:939)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:912)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.epapyrus.plugpdf.core.viewer.PageView.createEntireBitmap(PageView.java:609)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.epapyrus.plugpdf.core.viewer.PageView.drawEntire(PageView.java:239)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.epapyrus.plugpdf.core.viewer.PageView.setPage(PageView.java:218)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.epapyrus.plugpdf.core.viewer.PageAdapter$PageLoaderTask.onPostExecute(PageAdapter.java:127)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.epapyrus.plugpdf.core.viewer.PageAdapter$PageLoaderTask.onPostExecute(PageAdapter.java:89)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:632)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.os.AsyncTask.access$600(AsyncTask.java:177)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.os.Looper.loop(Looper.java:145)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6117)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    10-16 09:52:42.569 8633-8633/<Our package name> E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

    Any help will be appreciated.

    Best Regards,

    Saab

    #10455 Reply

    Dr. Plug
    Moderator

    Hello Saab,

    Thank you for the feedback and Sorry for your inconvenience.
    I investigated about OOM from the past. There were various reasons for the OOM problem, but among them,
    The most reason that problem happens was when user didn’t call ‘clear()’ when closing document is occupy a greater proportion.
    So could you add a clear method which is in ReaderView when you closing a PDF file?

    Best Regards
    Dr.Plug

    • This reply was modified 1 year, 1 month ago by  Dr. Plug.
    #11160 Reply

    Nicolas Buquet

    Hi Saab,

    I saw the same OOM error happened on my applications, especially on simulator using Android 6.

    I suspect PlugPDF bitmap creation to not be still optimal (but it will come, for sure).

    What seems to help a lot is to set option android:largeHeap = "true" in application` entry of manifest.

    I had a OOM error that appeared systematically when swipping quickly between pages of the first PDF file I opened.
    It disappeared with largeHeap option (hopefully for me).

    Hope it help,

    Nicolas Buquet

    #11194 Reply

    Julian

    Hello,

    we can reproduce OOM crashes with a large PDF (10MB).
    This is not due to clear, since it already happens in the first and only PDF view we create.
    It happens by scrolling back and forth the PDF quickly. According to the memory monitor, it is not an constant increase in allocated RAM which slowly hits the maximum, but it rather seems more like some sort of bug, where one huge allocation is being made (which is not even visible in the memory monitor). We also tried “largeHeap”, but it did not solve the issue.

    Please note that this is a critical issue for us, since we do not want to ship software which crashes under common conditions.

    Regards,
    Julian

    #11203 Reply

    Dr. Plug
    Moderator

    Hello, Julian

    We tried to reproduce that problem ( OOM crashes with a large PDF)
    Unfortunately, we couldn’t Even if we used a 32MB PDF, OOM didn’t happen.
    Could you give us a PDF file that problem happens? and Could you give us a video that problem is taken?
    If you give us those files, It would be very helpful to solve that problem.

    Best Regards,
    Dr.Plug

    • This reply was modified 9 months, 3 weeks ago by  Dr. Plug.
    #11397 Reply

    Aurelien Hubert

    I can reproduce this crash on my Pixel C with a “normal” PDF. I think the problem comes from the resolution of the tablet (2560 x 1800 pixels) and the quality of the preview. If you set a high quality (for example 2) : PropertyManager.setPreviewQualityCoef(2), after displaying some pages, you will encounter the crash.

    #11440 Reply

    Dr. Plug
    Moderator

    Hello, Aurelien

    We really appreciate your detailed feedback and error report.
    We are estimating when it will be fixed.
    We will contact you again shortly to let you know what we have done.
    Thank you for being patient and helping us improve.

    Best Regards,
    Dr.Plug
    PlugPDF Support

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Android SDK OutOfMemoryError
Your information: