Skip to content
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

有一张svga图,一播放整个项目就卡住了,有时间的话,可以帮忙看一下是什么原因吗? #9

Open
clbDream opened this issue Mar 14, 2022 · 3 comments

Comments

@clbDream
Copy link

    GlideApp.with(this)
        .asSVGA()
        .load("https://bbyy0108.oss-cn-shanghai.aliyuncs.com/gift/svga/%E4%B8%96%E7%BA%AA%E5%A9%9A%E7%A4%BC.svga")

// .load("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true")
.into(SVGATarget(iv_img, requestDynamicItemWithSpannableText()))

@clbDream
Copy link
Author

image

@YvesCheung
Copy link
Owner

2022-03-14 14:44:55.778 28305-30042/com.yy.mobile.svga.glideplugin.demo E/AndroidRuntime: FATAL EXCEPTION: Thread-4
    Process: com.yy.mobile.svga.glideplugin.demo, PID: 28305
    java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 39464 free bytes and 38KB until OOM, target footprint 268435456, growth limit 268435456; failed due to fragmentation (largest possible contiguous allocation 86507520 bytes)
        at com.opensource.svgaplayer.SVGAVideoSpriteFrameEntity.<init>(SVGAVideoSpriteFrameEntity.kt:99)
        at com.opensource.svgaplayer.SVGAVideoSpriteEntity.<init>(SVGAVideoSpriteEntity.kt:40)
        at com.opensource.svgaplayer.SVGAVideoEntity.resetSprites(SVGAVideoEntity.kt:125)
        at com.opensource.svgaplayer.SVGAVideoEntity.<init>(SVGAVideoEntity.kt:61)
        at com.opensource.svgaplayer.SVGAParser.parse(SVGAParser.kt:182)
        at com.opensource.svgaplayer.SVGAParser.access$parse(SVGAParser.kt:25)
        at com.opensource.svgaplayer.SVGAParser$parse$3.invoke(SVGAParser.kt:95)
        at com.opensource.svgaplayer.SVGAParser$parse$3.invoke(SVGAParser.kt:25)
        at com.opensource.svgaplayer.SVGAParser$FileDownloader$resume$1.run(SVGAParser.kt:61)
        at java.lang.Thread.run(Thread.java:923)

用SVGAParser本身也会崩溃,提Issue给 https://github.com/svga/SVGAPlayer-Android

@YvesCheung
Copy link
Owner

java.lang.StackOverflowError: stack size 1043KB
        at com.squareup.wire.internal.ImmutableList.get(ImmutableList.java:38)
        at java.util.AbstractList$Itr.next(AbstractList.java:371)
        at java.util.AbstractCollection.contains(AbstractCollection.java:102)
        at com.squareup.wire.internal.Internal.immutableCopyOf(Internal.java:61)
        at com.opensource.svgaplayer.proto.SpriteEntity.<init>(SpriteEntity.java:64)
        at com.opensource.svgaplayer.proto.SpriteEntity$Builder.build(SpriteEntity.java:149)
        at com.opensource.svgaplayer.proto.SpriteEntity$ProtoAdapter_SpriteEntity.decode(SpriteEntity.java:191)
        at com.opensource.svgaplayer.proto.SpriteEntity$ProtoAdapter_SpriteEntity.decode(SpriteEntity.java:153)
        at com.opensource.svgaplayer.proto.MovieEntity$ProtoAdapter_MovieEntity.decode(MovieEntity.java:242)
        at com.opensource.svgaplayer.proto.MovieEntity$ProtoAdapter_MovieEntity.decode(MovieEntity.java:206)
        at com.squareup.wire.ProtoAdapter.decode(ProtoAdapter.java:203)
        at com.squareup.wire.ProtoAdapter.decode(ProtoAdapter.java:185)
        at com.opensource.svgaplayer.SVGAParser$decodeFromInputStream$1.run(SVGAParser.kt:311)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

迭代SpriteEntity.frames的时候栈爆了,这个资源是有多少桢.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants