New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out of memory error #7

Open
Jublikon opened this Issue Dec 28, 2015 · 6 comments

Comments

Projects
None yet
6 participants
@Jublikon

Jublikon commented Dec 28, 2015

I have placed the animated view inside of a fragment that is hold by a ViewPager.
When I make the fragment visible for the first time everything is alright.
But when the fragment gets reloaded I get the following issue:

FATAL EXCEPTION: main
Process: com.ads.adstimer, PID: 14680
java.lang.OutOfMemoryError: Failed to allocate a 2007612 byte allocation with 1750816 free bytes and 1709KB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:831)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:739)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:615)
at com.hanks.htextview.animatetext.AnvilText.animateStart(AnvilText.java:67)
at com.hanks.htextview.animatetext.HText.animateText(HText.java:74)
at com.hanks.htextview.HTextView.animateText(HTextView.java:97)
at com.ads.adstimer.fragment.Registration.Slides.FragmentScanCode.onCreateView(FragmentScanCode.java:37)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1426)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:728)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1106)
at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
at android.support.v4.view.ViewPager$3.run(ViewPager.java:251)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

I hope, you can solve it.
I really like that library, good job!

@hanks-zyh

This comment has been minimized.

Show comment
Hide comment
@hanks-zyh

hanks-zyh Dec 29, 2015

Owner

@EnduroXPro Thank you for your feedback , I'm trying some way to fix OOM . if you can solve it , welcome to commit pull request

Owner

hanks-zyh commented Dec 29, 2015

@EnduroXPro Thank you for your feedback , I'm trying some way to fix OOM . if you can solve it , welcome to commit pull request

@xu6148152

This comment has been minimized.

Show comment
Hide comment
@xu6148152

xu6148152 Jan 1, 2016

I don't think that

System.gc() 

can always fix oom.

It's document

/**
     * Indicates to the VM that it would be a good time to run the
     * garbage collector. Note that this is a hint only. There is no guarantee
     * that the garbage collector will actually be run.
     */

xu6148152 commented Jan 1, 2016

I don't think that

System.gc() 

can always fix oom.

It's document

/**
     * Indicates to the VM that it would be a good time to run the
     * garbage collector. Note that this is a hint only. There is no guarantee
     * that the garbage collector will actually be run.
     */
@hanks-zyh

This comment has been minimized.

Show comment
Hide comment
@hanks-zyh

hanks-zyh Jan 1, 2016

Owner

@xu6148152 yes,System.gc() can't solve OOM problem, it should change the implement of the library if we want to sovle it fundamentally

Owner

hanks-zyh commented Jan 1, 2016

@xu6148152 yes,System.gc() can't solve OOM problem, it should change the implement of the library if we want to sovle it fundamentally

@hanks-zyh hanks-zyh added the bug label Jan 1, 2016

@wangmuge

This comment has been minimized.

Show comment
Hide comment
@wangmuge

wangmuge Jan 20, 2016

会发生OOM

wangmuge commented Jan 20, 2016

会发生OOM

@hanks-zyh hanks-zyh added the Backlog label Feb 22, 2016

@mattvb91

This comment has been minimized.

Show comment
Hide comment
@mattvb91

mattvb91 Jan 28, 2017

Same issue here

mattvb91 commented Jan 28, 2017

Same issue here

@mohitpant9

This comment has been minimized.

Show comment
Hide comment
@mohitpant9

mohitpant9 Feb 23, 2018

android:largeHeap="true"
in manifest file inside application Tag

mohitpant9 commented Feb 23, 2018

android:largeHeap="true"
in manifest file inside application Tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment