Hey guys, I was planning to work a project with de...
# compose-desktop
a
Hey guys, I was planning to work a project with desktop compose. But unfortunately, when I tried the default Intellij template for desktop compose, I faced some serious memory issues. It had only one default button, nothing else. But every click on the button increases the memory usage in the task manager. Every click shoots up the memory usage. And it stays up. A simple hello button app was taking down 250MB memory after few clicks. It started with around 140MB.
j
I'm not positive, but I think maybe the intellij template uses a really old build of Compose? Can you try with this project: https://github.com/JetBrains/compose-jb/tree/master/templates/desktop-template and let me know if you encounter the same issue?
a
Hey Jim, Sure, I'll try doing this once I reach home. I'll update you on this.
o
see https://github.com/JetBrains/compose-jb/tags for list of available builds
k
Last time I created one with Intelij, it was pretty old. I ended up creating a project in Android Studio (with the Multiplatform plugin) and then just added desktop compose manually
a
@jim I updated intellij to the latest version today. The compose version the default project uses is
Copy code
1.0.0-alpha3
I'm getting this much cpu and memory usage https://gfycat.com/FlawlessGeneralGenet Now, the memory doesn't keep infinetly increasing with the new plugin. But is that much cpu and memory usage normal for an app with only one button with some ripple effect?
Entire discord desktop app takes like 490MBs and it's running on electron.
j
To be clear, you updated the intellij version or the compose version? Just want to confirm you are using compose
1.0.0-alpha4-build385
?
a
@jim Updated the intellij version and the template it's using got updated too (I created a new project with the new template). The version of compose is the latest stable release version.
Copy code
1.0.0-alpha3
j
I would recommend trying with the latest build (ie.
1.0.0-alpha4-build385
). The last alpha3 release is rather old, and isn't much more stable than the dev builds (it is alpha, after all). The dev build is probably much closer to what will eventually be a beta build and I imagine you will have a better user experience with it. In particular, I seem to recall it having some CPU/memory fixes, so I'm wondering if it will measure better in your tests. Would be curious to hear if that performs better. That's what I was suggesting when I suggested using the linked template from the compose-jb repository and when Nikolay linked the latest versions page.
a
@jim I was just trying the latest build
Copy code
kotlin("jvm") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0-alpha4-build385"
But memory and cpu usage is exactly same. No significant improvement.
i
The high CPU usage is a bug, and it is already fixed, but there still no "stable" build with the fix, only intermediate (0.0.0-sync-2010-10-01-build378)
o
Note, that there’s no linear corrrelation between number of buttons and consumed memory
a
@Igor Demin the build
1.0.0-alpha4-build385
showed no improvement in memory or CPU usage unfortunately. If anything, I actually noticed the CPU usage even higher in the latest alpha build compared to alpha 3. The usage went up to 40% and higher at times.
i
1.0.0-build385 doesn't contain the fix. build 0.0.0-sync-2010-10-01-build378 does
a
Lemme try this.
@Igor Demin Omg the performance on
0.0.0-sync-2010-10-01-build378
is amazing!!!!!!!
CPU and Memory usages both are lower compared to other builds.
🎉 3
Darn I'm so happy rn lollll
🙂 3
i
soon the fix will be in the usual builds of "1.0.0-alpha4"
a
Ye, thank you so much guys. I can finally continue on my project.