sayyam / carouselview

A simple library to add carousel view in android app.
Apache License 2.0
1.15k stars 260 forks source link

Out of memory crash #97

Open drewmahrt opened 6 years ago

drewmahrt commented 6 years ago

I've seen a few out of memory crashes in the SwipeTask on line 400.

private class SwipeTask extends TimerTask {
        public void run() {
            containerViewPager.post(new Runnable() {     // line 400
                public void run() {
                    int nextPage = (containerViewPager.getCurrentItem() + 1) % getPageCount();
                    containerViewPager.setCurrentItem(nextPage, 0 != nextPage || animateOnBoundary);
                }
            });
        }
    }

Fatal Exception: java.lang.OutOfMemoryError Failed to allocate a 12 byte allocation with 808 free bytes and 808B until OOM; failed due to fragmentation (required continguous free 4096 bytes for a new buffer where largest contiguous free 0 bytes)