Skip to content

Reduce memory consumption by 10x#28

Merged
FN-FAL113 merged 2 commits into
FN-FAL113:mainfrom
its5Q:main
May 18, 2026
Merged

Reduce memory consumption by 10x#28
FN-FAL113 merged 2 commits into
FN-FAL113:mainfrom
its5Q:main

Conversation

@its5Q

@its5Q its5Q commented May 12, 2026

Copy link
Copy Markdown

By default, the Avalonia library uses GPU acceleration with OpenGL / Direct3D / Vulkan. This is quite overkill for an app as simple as this with not much graphics going on, and it turns this lightweight app into a 500MB RAM hog from all the GPU libraries being loaded. This PR switches Avalonia to software rendering, cutting RAM usage from 500-550MB to 50-60MB.

@FN-FAL113

FN-FAL113 commented May 13, 2026

Copy link
Copy Markdown
Owner

How come its running way less on mine? I've never seen the app use more than 100mb of ram.
image

@its5Q

its5Q commented May 13, 2026

Copy link
Copy Markdown
Author

Task Manager doesn't report actual memory usage. Use System Informer or your profiler of choice for this:
изображение
изображение
It's mostly commit memory from big NVIDIA and OpenGL libraries (so it also might be less on some GPUs).
So it's not reported in Task Manager in the total memory usage, but is part of the commited memory shown. And if Windows runs out of commit memory, it will start killing processes, even though Task Manager could happily tell you that you only have 70% used memory.

@FN-FAL113

Copy link
Copy Markdown
Owner

Git checks fails with this small change.

@its5Q

its5Q commented May 14, 2026

Copy link
Copy Markdown
Author

Huh, weird. On my machine it passes all tests including the one it fails in the CI checks.

@FN-FAL113

Copy link
Copy Markdown
Owner

I re-ran the tests again and it passed, gh actions might be broken last time lol since I rerun it multiple times and it fails.

@FN-FAL113

Copy link
Copy Markdown
Owner

Have you tried this on any linux distro? Does it run without issues?

@its5Q

its5Q commented May 14, 2026

Copy link
Copy Markdown
Author

Let me try in WSL real quick, but it should work because this option is only applied for Windows.

@its5Q

its5Q commented May 14, 2026

Copy link
Copy Markdown
Author

Runs and passes tests, looks good

@FN-FAL113

Copy link
Copy Markdown
Owner

Sorry, I mean if the app compiles properly for linux config (dotnet publish -c release -r linux-64) and is functionally tested by opening the compiled app and using it.

@its5Q

its5Q commented May 18, 2026

Copy link
Copy Markdown
Author

Oh, yeah, it does, I just didn't attach the screenshot of the GUI, but I tested it under WSL (you can launch GUI apps in WSL). Right now I'm out of the country, so I can't help further

@FN-FAL113 FN-FAL113 merged commit 8f38faa into FN-FAL113:main May 18, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants