android - StrictMode DiskReadViolation on ListView fling -
my fragment generating huge bunch of disk read strict mode violations , flashing screen when small fling or scroll. running app on samsung android 4.4.2.
the list view in fragment populated custom content provider using custom cursor adaptor. have not handled fling or scroll events might trigger disk read. getting these violations when fragment starts reasonable because getloadermanager().initloader()
in onresume()
. don't understand why fragment attempt disk read on fling.
out of approx 500 logcat lines tag strictmode
generated, have pasted few here. idea causing this?
@targetapi(11) public static void enablestrictmode() { // strict mode available on gingerbread or later if (utils.hasgingerbread()) { // enable thread strict mode policies strictmode.threadpolicy.builder threadpolicybuilder = new strictmode.threadpolicy.builder() .detectall() .penaltylog(); // enable vm strict mode policies strictmode.vmpolicy.builder vmpolicybuilder = new strictmode.vmpolicy.builder() .detectall() .penaltylog(); // honeycomb introduced additional strict mode features if (utils.hashoneycomb()) { // flash screen when thread policy violated threadpolicybuilder.penaltyflashscreen(); // each activity class, set instance limit of 1. more instances , // there memory leak. vmpolicybuilder .setclassinstancelimit(contactslistactivity.class, 1) .setclassinstancelimit(contactdetailactivity.class, 1); } // use builders enable strict mode policies strictmode.setthreadpolicy(threadpolicybuilder.build()); strictmode.setvmpolicy(vmpolicybuilder.build()); } }
logcat :
strictmode policy violation; ~duration=15 ms: android.os.strictmode$strictmodediskreadviolation: policy=2335 violation=2 @ android.os.strictmode$androidblockguardpolicy.onreadfromdisk(strictmode.java:1156) @ libcore.io.blockguardos.open(blockguardos.java:106) @ libcore.io.iobridge.open(iobridge.java:393) @ java.io.fileoutputstream.<init>(fileoutputstream.java:88) @ java.io.fileoutputstream.<init>(fileoutputstream.java:128) @ java.io.fileoutputstream.<init>(fileoutputstream.java:117) @ com.android.server.ssrm.ssrmutil.writesysfs(ssrmutil.java:134) @ com.android.server.ssrm.customfrequencymanagerservice.acquirecpudvfslock(customfrequencymanagerservice.java:2321) @ com.android.server.ssrm.customfrequencymanagerservice.acquiredvfslocklocked(customfrequencymanagerservice.java:1929) @ com.android.server.ssrm.customfrequencymanagerservice.acquiredvfslock(customfrequencymanagerservice.java:1880) @ android.os.icustomfrequencymanager$stub.ontransact(icustomfrequencymanager.java:274) @ android.os.binder.exectransact(binder.java:404) @ dalvik.system.nativestart.run(native method) # via binder call stack: android.os.strictmode$logstacktrace @ android.os.strictmode.readandhandlebindercallviolations(strictmode.java:1726) @ android.os.parcel.readexceptioncode(parcel.java:1447) @ android.os.parcel.readexception(parcel.java:1416) @ android.os.icustomfrequencymanager$stub$proxy.acquiredvfslock(icustomfrequencymanager.java:766) @ android.os.customfrequencymanager$cpudvfscontrolrequest.dofrequencyrequestimpl(customfrequencymanager.java:458) @ android.os.customfrequencymanager$frequencyrequest.dofrequencyrequest(customfrequencymanager.java:218) @ android.os.dvfshelper.acquire(dvfshelper.java:495) @ android.os.dvfshelper.acquire(dvfshelper.java:288) @ android.widget.abslistview.reportscrollstatechange(abslistview.java:5433) @ android.widget.abslistview.startscrollifneeded(abslistview.java:3858) @ android.widget.abslistview.ontouchmove(abslistview.java:4745) @ android.widget.abslistview.ontouchevent(abslistview.java:4600) @ android.view.view.dispatchtouchevent(view.java:8149) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2416) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2140) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ com.android.internal.policy.impl.phonewindow$decorview.superdispatchtouchevent(phonewindow.java:2295) @ com.android.internal.policy.impl.phonewindow.superdispatchtouchevent(phonewindow.java:1622) @ android.app.activity.dispatchtouchevent(activity.java:2565) @ android.support.v7.app.actionbaractivitydelegateics$windowcallbackwrapper.dispatchtouchevent(actionbaractivitydelegateics.java:268) @ com.android.internal.policy.impl.phonewindow$decorview.dispatchtouchevent(phonewindow.java:2243) @ android.view.view.dispatchpointerevent(view.java:8357) @ android.view.viewrootimpl$viewpostimeinputstage.processpointerevent(viewrootimpl.java:4778) @ android.view.viewrootimpl$viewpostimeinputstage.onprocess(viewrootimpl.java:4644) @ android.view.viewrootimpl$inputstage.deliver(viewrootimpl.java:4202) @ android.view.viewrootimpl$inputstage.ondelivertonext(viewrootimpl.java:4256) @ strictmode policy violation; ~duration=14 ms: android.os.strictmode$strictmodediskwriteviolation: policy=2335 violation=1 @ android.os.strictmode$androidblockguardpolicy.onwritetodisk(strictmode.java:1130) @ libcore.io.blockguardos.write(blockguardos.java:196) @ libcore.io.iobridge.write(iobridge.java:450) @ java.io.fileoutputstream.write(fileoutputstream.java:187) @ java.io.outputstream.write(outputstream.java:82) @ com.android.server.ssrm.ssrmutil.writesysfs(ssrmutil.java:135) @ com.android.server.ssrm.customfrequencymanagerservice.acquirecpudvfslock(customfrequencymanagerservice.java:2321) @ com.android.server.ssrm.customfrequencymanagerservice.acquiredvfslocklocked(customfrequencymanagerservice.java:1929) @ com.android.server.ssrm.customfrequencymanagerservice.acquiredvfslock(customfrequencymanagerservice.java:1880) @ android.os.icustomfrequencymanager$stub.ontransact(icustomfrequencymanager.java:274) @ android.os.binder.exectransact(binder.java:404) @ dalvik.system.nativestart.run(native method) # via binder call stack: android.os.strictmode$logstacktrace @ android.os.strictmode.readandhandlebindercallviolations(strictmode.java:1726) @ android.os.parcel.readexceptioncode(parcel.java:1447) @ android.os.parcel.readexception(parcel.java:1416) @ android.os.icustomfrequencymanager$stub$proxy.acquiredvfslock(icustomfrequencymanager.java:766) @ android.os.customfrequencymanager$cpudvfscontrolrequest.dofrequencyrequestimpl(customfrequencymanager.java:458) @ android.os.customfrequencymanager$frequencyrequest.dofrequencyrequest(customfrequencymanager.java:218) @ android.os.dvfshelper.acquire(dvfshelper.java:495) @ android.os.dvfshelper.acquire(dvfshelper.java:288) @ android.widget.abslistview.reportscrollstatechange(abslistview.java:5433) @ android.widget.abslistview.startscrollifneeded(abslistview.java:3858) @ android.widget.abslistview.ontouchmove(abslistview.java:4745) @ android.widget.abslistview.ontouchevent(abslistview.java:4600) @ android.view.view.dispatchtouchevent(view.java:8149) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2416) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2140) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ android.view.viewgroup.dispatchtransformedtouchevent(viewgroup.java:2422) @ android.view.viewgroup.dispatchtouchevent(viewgroup.java:2155) @ com.android.internal.policy.impl.phonewindow$decorview.superdispatchtouchevent(phonewindow.java:2295) @ com.android.internal.policy.impl.phonewindow.superdispatchtouchevent(phonewindow.java:1622) @ android.app.activity.dispatchtouchevent(activity.java:2565) @ android.support.v7.app.actionbaractivitydelegateics$windowcallbackwrapper.dispatchtouchevent(actionbaractivitydelegateics.java:268) @ com.android.internal.policy.impl.phonewindow$decorview.dispatchtouchevent(phonewindow.java:2243) @ android.view.view.dispatchpointerevent(view.java:8357) @ android.view.viewrootimpl$viewpostimeinputstage.processpointerevent(viewrootimpl.java:4778) @ android.view.viewrootimpl$viewpostimeinputstage.onprocess(viewrootimpl.java:4644) @ android.view.viewrootimpl$inputstage.deliver(viewrootimpl.java:4202) @ android.view.viewrootimpl$inputstage.ondelivertonext(viewrootimpl.java:4256) @ android.view.viewrootimpl$inputstage.forward(viewrootimpl.java:4225)
Comments
Post a Comment