Mobile-UXSDK-Android icon indicating copy to clipboard operation
Mobile-UXSDK-Android copied to clipboard

MotionLayout中有RadarWidget,会造成内存溢出

Open luoyexk opened this issue 5 years ago • 1 comments

Fatal Exception: java.lang.OutOfMemoryError Failed to allocate a 532648 byte allocation with 514280 free bytes and 502KB until OOM, max allowed footprint 268435456, growth limit 268435456 dji.midware.parser.plugins.DJIPluginRingBufferAsyncParser$ByteBufferQueue.g (Unknown Source:293) dji.midware.parser.plugins.DJIPluginRingBufferAsyncParser$ByteBufferQueue.a (Unknown Source:13) dji.midware.parser.plugins.DJIPluginRingBufferAsyncParser$ByteBufferQueue.a (Unknown Source:1) dji.midware.parser.plugins.DJIPluginRingBufferAsyncParser.b (Unknown Source:5) dji.midware.parser.plugins.DJIPluginRingBufferAsyncParser.a (Unknown Source:7) dji.midware.usb.P3.AoaRawDataReceiver$2.run (Unknown Source:182)

    <androidx.constraintlayout.motion.widget.MotionLayout
        android:id="@+id/motionLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layoutDescription="@xml/scene_fragment_auto_flight">

        <ViewA_Map />
        <ViewB_DJI_FPV />

        <FrameLayout
            android:id="@+id/radar_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="@dimen/dp_60"
            android:layout_marginTop="@dimen/dp_70"
            android:layout_marginRight="@dimen/dp_60"
            android:layout_marginBottom="@dimen/dp_70"
            android:translationZ="@dimen/translate_z_small">

            <dji.ux.widget.RadarWidget
                android:id="@+id/radar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:alpha="0" />

        </FrameLayout>
    </androidx.constraintlayout.motion.widget.MotionLayout>

通过MotionScene动态切换A和B的大小,动画中不涉及RadarWidget,2分钟内,会抛出上述异常。

把MotionLayout换成ConstarintLayout后没异常。

luoyexk avatar Jul 24 '20 09:07 luoyexk

Agent comment from Lisa Fedane in Zendesk ticket #37280:

We can look into this for you but first, can you provide a sample of your animation code that shows how you are doing this: "Dynamically switch the size of A and B through MotionScene"

Lisa Fedane DJI Developer Support, US

Join DJI's Developer Community in our new Forum for Technical Discussions, Announcements and More: https://forum.dji.com/forum-139-1.html?from=developer

dji-dev avatar Jul 24 '20 21:07 dji-dev