Skip to content

Conversation

@myungjoo
Copy link
Member

Lazily initialize the internal message thread and queue for ml_service_extension to prevent memory growth on repeated new/destroy calls.

Previously, ml_service_new() for extension services would always create an internal message queue and worker thread, even if no actual requests were made. Rapidly calling ml_service_new() and ml_service_destroy() would lead to accumulated thread/allocator cache resources (e.g., from GLib/GObject) that were not immediately released by the OS, causing the RSS to continuously increase and appear as a memory leak. This change ensures the thread and queue are only created on the first actual request.


Open in Cursor Open in Web

Co-authored-by: myungjoo.ham <myungjoo.ham@samsung.com>
@cursor
Copy link

cursor bot commented Dec 12, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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.

3 participants