zed
zed copied to clipboard
GPUI's hello world demo takes up 170M+ of memory on windows
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
GPUI's hello world demo takes up 170M+ of memory on windows, zed empty project memory usage 300M+
I built them all in release mode
https://github.com/wang-zhichuang/gpui-demo
Environment
Device name LAPTOP-VJ4R75T5 CPU AMD Ryzen 7 4800H with Radeon Graphics 2.90 GHz RAM 16.0 GB (15.4 GB usable)
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
No response
Interesting. On my machine (Mac) it's about 28 MB and 6-8 threads (changes over time).
Now that creating more than one window on Windows is fixed, there is a issue that relates to this. For each window that is created it consumes something roughly to 130mb, when the window is closed the memory is not freed. Seems like a memory leak issue.
Somehow my latest Zed build only uses 75mb with a loaded project, while the hello world application and my gpui application takes roughly 170mb.
Running my gpui application after a while it randomly deallocated the ram and it dropped to less than 18mb.
Now that creating more than one window on Windows is fixed, there is a issue that relates to this. For each window that is created it consumes something roughly to 130mb, when the window is closed the memory is not freed. Seems like a memory leak issue.
Somehow my latest Zed build only uses 75mb with a loaded project, while the hello world application and my gpui application takes roughly 170mb.
Running my gpui application after a while it randomly deallocated the ram and it dropped to less than 18mb.
After the pr https://github.com/zed-industries/zed/pull/12340 hello world program now on my machine 50 m + memory footprint. That's perfectly acceptable, but I didn't find that it would drop to 18M after a while like you said
When I force my system to run out of memory, the GPUI application drops to roughly 25mb for me. When there is plenty of memory it still stays at 25mb. I'm not sure why, but this extra memory is related to creating new windows (which most likely is related to blade).
There is a lot of memory allocated in private bytes
compared to the working set
. I assume this is where the extra memory is coming from, this also explains why Windows deallocates that extra memory when its starts to run out of memory because It is not actually backed by any ram. This memory isn't actually being used so there's not much problem but It can seem that way when just looking at the memory usage in Task Manager.
I'm still unsure how to determine where this allocation is specifically coming from, kvark suggested these reasons https://github.com/zed-industries/zed/pull/12340#issuecomment-2136480998 .
When I force my system to run out of memory, the GPUI application drops to roughly 25mb for me. When there is plenty of memory it still stays at 25mb. I'm not sure why, but this extra memory is related to creating new windows (which most likely is related to blade).
There is a lot of memory allocated in
private bytes
compared to theworking set
. I assume this is where the extra memory is coming from, this also explains why Windows deallocates that extra memory when its starts to run out of memory because It is not actually backed by any ram. This memory isn't actually being used so there's not much problem but It can seem that way when just looking at the memory usage in Task Manager.I'm still unsure how to determine where this allocation is specifically coming from, kvark suggested these reasons #12340 (comment) .
ok! Thank you for your reply!
Now that I have basically solved my problem, I think this issue can be put to rest. I have closed this issue