-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Creating multiple instances of a ShowcaseView crashes the application with an outOfMemory error. #183
Comments
Yeah, thought I had sorted this but apparently not. I'll take a look! |
@amlcurran : I'm referencing 5.0.0-SNAPSHOT in the Gradle.build file. Am I using an old version maybe? I couldn't find a better reference sadly. If i've got the version wrong I can change that and let you know! |
No that is the right version. I'm made it such that it should free memory when you hide a ShowcaseView, I'll push that soon and if you try using the latest snapshot tomorrow, can you let me know if it works for you? |
Ah fantastic, will give that a go tomorrow and let you know! Thank you! |
Heya, sorry for the no reply! Got around to trying it, sadly the same error with the same stack trace today despite having been using the newer snapshot! |
Same for me... |
I have the same problem. Android emulator: |
I seems like the recycle() function is not working well. What I had to do to fix it is add a method to set by my own the bitmapBuffer. Also I could only call the .recycle() on the onDestroy() of my activity. |
I'm having this issue as well (I display another ShowcaseView when the button on my first one is clicked). I can't consistently repro it, but it's showing up in my crash logs. One fix might be to call System.gc() in clearBitmap() (even though some people get squeamish about calling it, I've found it helps when create large bitmaps in a short period of time).
|
Merged a PR which should address this - #204 - so that will appear in the 5.1.0 snapshots now available |
I am still getting this error. I have latest version 5.4.1 but i still get the same error. |
@swatijet can you please post more details about how you're using
|
I am using two instances of showcaseview in my 2 activities. One of my activities have 2 fragments. I am only getting error on samsung devices where the bitmap created is very big. This is the order of call :- Fragment 1 --> Child Fragment --> to main activity. At the end of each call , i call showcaseview.hide(). This all works fine but when i move to another activity after hide() is called in main activity, I get the crash. In another activity, i have about 9 targets to show, but error comes as soon as the first target is loaded. |
i am still getting this error but only in the Galaxy S4 and Galaxy s5 devices. |
Hmmm I wonder if Samsung is leaking memory somewhere. I have a Samsung device at work and will try to reproduce this |
@amlcurran any update on the error? |
Stack Trace: 05-20 17:59:09.166 30218-30218/com.******_._***** E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:726)
at android.graphics.Bitmap.createBitmap(Bitmap.java:703)
at android.graphics.Bitmap.createBitmap(Bitmap.java:670)
at com.github.amlcurran.showcaseview.ShowcaseView.updateBitmap(ShowcaseView.java:202)
at com.github.amlcurran.showcaseview.ShowcaseView.onGlobalLayout(ShowcaseView.java:370)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:839)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2050)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6364)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:561)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
at dalvik.system.NativeStart.main(Native Method)
Steps to reproduce:
Create six separate instances of a ShowcaseView in four different views using the procedure detailed in the README.md.
Noted, this could be an application specific issue, however memory usage continually rises each time a ShowcaseView is created.
Device:
Galaxy S3 LTE, GT-I9305 running Android 4.3
The text was updated successfully, but these errors were encountered: