Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6434 Reply

    Richard

    Hi,

    I have just experienced the following OutOfMemoryError when swiping through a PDF:

    java.lang.OutOfMemoryError: Failed to allocate a 11993100 byte allocation with 5482020 free bytes and 5MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:817)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:794)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:761)
    at com.epapyrus.plugpdf.core.viewer.PageView.adjustPatch(PageView.java:425)
    at com.epapyrus.plugpdf.core.viewer.SinglePageDisplay.onUserInteractionComplete(SinglePageDisplay.java:159)
    at com.epapyrus.plugpdf.core.viewer.SinglePageDisplay$2.run(SinglePageDisplay.java:268)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

    #6435 Reply

    Dr. Plug
    Moderator

    Hi Richard,

    Sorry for your inconvenience. In what ways did you test? i can’t found out with my sample project and PDF file on device of API 4.1.1. Could you please explain more detail? Do you occurs at first attempt?

    Cheers,
    Dr.Plug

    #6436 Reply

    Richard

    Hi,

    I have just created it again by opening one PDF, swiping through the three pages back and forth a few times, then exiting, then going to another PDF document and swiped once to the right and it crashed. If it’s anything to note, the first document I swiped through is the one that I got annotations working on. Therefore, the document has two line annotations on the first page.

    I don’t think this will be of a major reason but to note is that I am running this on Android 5 Lollipop (Nexus 9).

    I will see if there is a pattern in the mean time but it seems a little random when it crashes but that’s all I can give you at the moment. I hope it helps.

    #6437 Reply

    Dr. Plug
    Moderator

    Hi Richard,

    It’s my guess, you didn’t call clear() method in the ReaderView. If not call clear() method, our SDK do not dispose memory. So, please check it in your project. If you are calling clear(), can i receive a source file you are using about our SDK?

    Thanks,
    Dr.Plug

    #6438 Reply

    Richard

    Nope, not calling that method. Will add and then from what you say I should no longer have the issue.

    #6439 Reply

    Richard

    Seems ok now so thanks for the help, much appreciated. Very happy with the SDK now.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: OutOfMemoryError when
Your information: