Open SongOnWater opened 1 year ago
I tried to fix it by resizing the image and after testing the memory problem seems to be solved, but for some reason it crash easily, i need to work on it for a while.
I tried to fix it by resizing the image and after testing the memory problem seems to be solved, but for some reason it crash easily, i need to work on it for a while.
Great, thanks for your effort. Hope you can make it well soon.
@SongOnWater Hi, I found that there seems to be no top crash in kotlin
1.9.0, I am going to release a version based on kotlin
1.9.0, you can test it.
That sounds like a good idea. But do you have any clue about the root cause of the issue.
The error message is similar to this issue https://github.com/JetBrains/compose-multiplatform/issues/3138, I tried 1.9.0 only after reading this, but I'm not sure if it's a cause.
I had published a version 1.6.5
, you can try it.
I have tried the version 1.6.5 and the latest code on master branch. It works better currently, not get crashed. But I have observed the memory usage on iOS device, it still keeps rising while you scroll the pictures to loading more or switch between the network, Gif or Svg scenes. As the memory increasing, the App will become sluggish. As comparison, I do the same test on Android device, the memory usage also rises after the operations, but it will fall down after a while. I think maybe the GC works on Android device to release the memory. The problem maybe that the GC not work or work well on iOS device with the code written by KMM.
The current gc on native is not good, you can try new custom allocator by use freeCompilerArgs.add("-Xallocator=custom")
.
for more: https://kotlinlang.org/docs/whatsnew19.html#preview-of-custom-memory-allocator
if change the default small image to raw image , as following "val imageUrl: String get() = urls?.raw ?: url " in Image.kt in the sample , the memory will be drained soon on iOS device.