New issue
Advanced search Search tips

Issue 871209 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 16
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

WebView crashes when scrolling many images

Reported by nitinsha...@gmail.com, Aug 6

Issue description

Example URL:

Steps to reproduce the problem:
1. Open Application
2. Click on any story
3. Scroll left to right.
4. Scroll up and down.

What is the expected behavior?
User should able to scroll and see images

What went wrong?
It shows black and white space. it crash many times

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 68.0.3440.75  Channel: n/a
OS Version: 6.0.1
Flash Version:
 
logchrome.txt
27.4 KB View Download
logchrome.txt
27.4 KB View Download
logchrome.txt
27.4 KB View Download
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Components: Mobile>WebView
Labels: Needs-Feedback WV-Triaged
Unable to reproduce this issue with webview version 68.0.3440.75 and 68.0.3440.85 using Nexus5/Android 6.0. 

1. Installed attached app-debug.apk
2. Clicked on story , Scrolled left to right
3. Scrolled top to bottom and didn't observe any crash.

@nitinsharma639: Could you please check the steps and let us know if we miss anything? Please let us know which webview version you are using? Please update webview version to latest and let us knwow if issue is fixed. Providing device details along with screencast would help us in better triaging.

Thanks!
Hello there 

This issue not occurs on all devices. Please check log. It is happening on OnePlus Devices. It may occur on other devices as well. Can you suggest me some way or optimization so it would not occur.

Thanks 
Project Member

Comment 4 by sheriffbot@chromium.org, Aug 7

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Hmm couldn't symbolize the attached log straight away (I assume the attached 3 logs are all identical).

However I am seeing an "Out of memory error" in the logs as below. Could that perhaps be the reason?

--

08-06 17:13:48.558 337-337/? A/DEBUG: Abort message: '[FATAL:memory.cc(22)] Out of memory. size=22380544
    '
        r0 00000000  r1 8bc98ec0  r2 00000400  r3 00000000
        r4 00000001  r5 942c0578  r6 a56f3ac8  r7 942c0138
        r8 942c011d  r9 942c011c  sl 942c0574  fp 00000032
        ip 942c0138  sp 942c0108  lr a43d0c57  pc a43d0d22  cpsr 600d0030
08-06 17:13:48.559 337-337/? A/DEBUG: backtrace:
        #00 pc 011d7d22  /data/app/com.google.android.webview-2/lib/arm/libwebviewchromium.so (offset 0x724000)

Hello 

Yes this is because out of memory. Can you please point out how can I resolve it. It causing screen to be blank.

I am using following code.


        final WebSettings webSettings = webview.getSettings();
// use cookies to remember a logged in status
        CookieSyncManager.createInstance(getActivity());
        CookieSyncManager.getInstance().startSync();

        webview.setWebViewClient(new MyAppWebViewClient());

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
            newsdetailtextview.startSafeBrowsing(getActivity(), safebrowsingcallback);
        }


        webSettings.setLoadWithOverviewMode(true);
        webSettings.setUseWideViewPort(true);
        webSettings.setLoadsImagesAutomatically(true);
        webSettings.setLightTouchEnabled(true);
        webSettings.setSupportMultipleWindows(false);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            webview.setNestedScrollingEnabled(false);

        }

        Log.e("NewsDetailFragment", "html " + finalDetails);
        webSettings.setGeolocationEnabled(false);
        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        webSettings.setAppCacheEnabled(false);
        webSettings.setNeedInitialFocus(false);
        webSettings.setSaveFormData(false);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        webSettings.setSavePassword(false);
        webSettings.setEnableSmoothTransition(true);
        webSettings.setSaveFormData(false);
        webSettings.setDomStorageEnabled(false);
        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
        webSettings.setSupportZoom(false);
        newsdetailtextview.setBackgroundColor(Color.TRANSPARENT);
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.setAcceptCookie(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            cookieManager.setAcceptThirdPartyCookies(newsdetailtextview, true);
        }
//        webview.setOverScrollMode();
//        webview.setLayerType(View.LAYER_TYPE_SOFTWARE, new Paint());
        webview.loadDataWithBaseURL("https://www.punjabkesari.in/", finalDetails, "text/html; charset=UTF-8", null, null);
        webview.setTag(html);
        webview.setOnTouchListener(onWebviewTouch);
        webview.setWebChromeClient(new MyWebChromeClient(this));

 

Status: WontFix (was: Unconfirmed)
Yeah, decoding and rendering images takes a lot of memory. Very easy to run out of virtual address space (which is what's happening here) on a 32bit device / app.

Follow best practices on the web like unloading the images that are offscreen. Maybe this helps:
https://developers.google.com/web/updates/2016/07/infinite-scroller

Sign in to add a comment