cvzi / darkmodewallpaper

🌓 A live wallpaper for Android that respects dark theme mode 🌇
https://f-droid.org/packages/com.github.cvzi.darkmodewallpaper/
GNU General Public License v3.0
143 stars 11 forks source link

High memory usage #195

Open ihatemakinganaccount opened 4 weeks ago

ihatemakinganaccount commented 4 weeks ago

I've started using this up this week and noticed that the average memory use over 3 hours, as well as immediate usage by the service, is 350MB. I think this is rather excessive.

I killed and restarted the app, and it went to ~130MB, which is still high imo. But it also goes up by 15-25MB every time the dark/light mode is switched.

Try:

  1. Set the mode of wallpaper changing to "Follow system"
  2. Kill the app and restart it
  3. Enable the phone's Android developer options
  4. View the Running services
  5. Observe the value of DarkModeLiveWallpaper
  6. Switch between dark and light mode in Android (I use a quick settings tile)

The value of memory usage goes up and stays.

Also, I'm not using any effects (zoom, scroll, color overlay), and lock screen settings are not separate from wallpaper settings.

Anyway, thanks for the app. Cool little thing otherwise.

My phone: Motorola G32 w. CalyxOS 5.7.2 (Android 14)

cvzi commented 3 weeks ago

I'll look into it, maybe there is a memory leak somewhere

cvzi commented 3 weeks ago

I have found two memory leaks. I have resolved one of them. The other one is not relevant as far as I can tell because it seems to only occur when the wallpaper was set to the app and then changed to another live wallpaper. It will take a few days until the next version is built and published.

Also as far as I understand, Android will only free memory if the overall free memory is low, so the amount of memory the app uses may be overstated if there is still free memory on the device left.

ihatemakinganaccount commented 3 weeks ago

Possibly, but the Running Services screen should be mostly accurate. Other resident apps I use are shown to take much less memory - right after reboot it's NTFY notification manager 7MB, KDE Connect 15MB, K-9 mail 40MB, Hypatia antivirus 50MB, Rethink DNS 50MB, HeliBoard keyboard 60MB, DMLW 96MB, so it's still a bit high from the start.

But okay, if it can stay at least at this level without ballooning... :)

Thanks!

ihatemakinganaccount commented 6 days ago

@cvzi it's still doing it, after I switch mode a few times, memory usage gets to pretty high levels :/

cvzi commented 1 day ago

I can't really reproduce this. On my phones and on the emulator, the memory goes up, but then it also goes down again.