[GH-ISSUE #282] Potential Memory Leak? #240

Closed
opened 2026-05-05 05:08:53 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @qinyuhang on GitHub (Nov 10, 2023).
Original GitHub issue: https://github.com/keycastr/keycastr/issues/282

Hi, After using keycastr for a while (2 week on the background without casting key), the memory usage of keycastr is running up to 7GB.

image image
Originally created by @qinyuhang on GitHub (Nov 10, 2023). Original GitHub issue: https://github.com/keycastr/keycastr/issues/282 Hi, After using keycastr for a while (2 week on the background without casting key), the memory usage of keycastr is running up to 7GB. <img width="842" alt="image" src="https://github.com/keycastr/keycastr/assets/6239057/7bd6a068-4cf2-4863-bcf9-4bb923e4becd"> <img width="839" alt="image" src="https://github.com/keycastr/keycastr/assets/6239057/5a4cef94-4ebb-4c58-879f-39c17f8270df">
Author
Owner

@akitchen commented on GitHub (Nov 10, 2023):

Thank you for opening an issue; are you saying that keycasting was disabled during that time?

<!-- gh-comment-id:1806191960 --> @akitchen commented on GitHub (Nov 10, 2023): Thank you for opening an issue; are you saying that keycasting was disabled during that time?
Author
Owner

@akitchen commented on GitHub (Nov 22, 2023):

I haven't seen anything close to this kind of memory utilization, nothing over 100-150MB (which already seems high to me, but no signs of a leak)

What more can you say about your setup? One can see that you are running in Chinese locale, but are you using any other applications which monitor or generate input events or interfere with the windowing system? And to be clear, did you have keycasting disabled during this time, or simply weren't using your computer? If keycasting wasn't disabled, which visualizer were you using?

I'm inclined to close this, but if there's any more information that can be provided, I'm still interested in investigating.

<!-- gh-comment-id:1821930243 --> @akitchen commented on GitHub (Nov 22, 2023): I haven't seen anything close to this kind of memory utilization, nothing over 100-150MB (which already seems high to me, but no signs of a leak) What more can you say about your setup? One can see that you are running in Chinese locale, but are you using any other applications which monitor or generate input events or interfere with the windowing system? And to be clear, did you have keycasting disabled during this time, or simply weren't using your computer? If keycasting wasn't disabled, which visualizer were you using? I'm inclined to close this, but if there's any more information that can be provided, I'm still interested in investigating.
Author
Owner

@qinyuhang commented on GitHub (Nov 30, 2023):

I haven't seen anything close to this kind of memory utilization, nothing over 100-150MB (which already seems high to me, but no signs of a leak)

What more can you say about your setup? One can see that you are running in Chinese locale, but are you using any other applications which monitor or generate input events or interfere with the windowing system? And to be clear, did you have keycasting disabled during this time, or simply weren't using your computer? If keycasting wasn't disabled, which visualizer were you using?

I'm inclined to close this, but if there's any more information that can be provided, I'm still interested in investigating.

Hi, during the time, keycastr was disabled, not casting keys. What confused me is that I can't reproduce the situation. I'll dig into find how to reproduce it.

<!-- gh-comment-id:1834099708 --> @qinyuhang commented on GitHub (Nov 30, 2023): > I haven't seen anything close to this kind of memory utilization, nothing over 100-150MB (which already seems high to me, but no signs of a leak) > > > > What more can you say about your setup? One can see that you are running in Chinese locale, but are you using any other applications which monitor or generate input events or interfere with the windowing system? And to be clear, did you have keycasting disabled during this time, or simply weren't using your computer? If keycasting wasn't disabled, which visualizer were you using? > > > > I'm inclined to close this, but if there's any more information that can be provided, I'm still interested in investigating. Hi, during the time, keycastr was disabled, not casting keys. What confused me is that I can't reproduce the situation. I'll dig into find how to reproduce it.
Author
Owner

@akitchen commented on GitHub (Nov 30, 2023):

Thanks for the additional info. I did run a long-running session in the profiler and saw some large memory growth in Apple framework internals, but I think it was due to zombie and ref count monitoring and not actually a bug. Running outside of the profiler, I don't yet see this kind of growth but I will keep trying.

This did help pinpoint an optimization we can do, where fewer objects would be created and thrown away into the autorelease pool during normal usage of the app. I don't think that's related to what you were seeing, because this codepath is disabled when casting is disabled, but it still seems like a good idea to pursue. I'll keep looking into it as well.

<!-- gh-comment-id:1834157472 --> @akitchen commented on GitHub (Nov 30, 2023): Thanks for the additional info. I did run a long-running session in the profiler and saw some large memory growth in Apple framework internals, but I think it was due to zombie and ref count monitoring and not actually a bug. Running outside of the profiler, I don't yet see this kind of growth but I will keep trying. This did help pinpoint an optimization we can do, where fewer objects would be created and thrown away into the autorelease pool during normal usage of the app. I don't think that's related to what you were seeing, because this codepath is disabled when casting is disabled, but it still seems like a good idea to pursue. I'll keep looking into it as well.
Author
Owner

@akitchen commented on GitHub (Jan 5, 2024):

I'm going to close this out; there isn't evidence of a significant memory leak, but running in the profiler or with different memory debugging options enabled can cause unexpected growth as objects are kept around for zombie detection or other inspection.

<!-- gh-comment-id:1878983666 --> @akitchen commented on GitHub (Jan 5, 2024): I'm going to close this out; there isn't evidence of a significant memory leak, but running in the profiler or with different memory debugging options enabled can cause unexpected growth as objects are kept around for zombie detection or other inspection.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/keycastr#240
No description provided.