Skip to content

Memory leak #94

@khromov

Description

@khromov

👋 I deployed this package a while ago on a SvelteKit site using Node.js and there appears to be a memory leak where each connection instance is not being cleaned up. Here's a small heap snapshot comparison:

Recently started (17 instances of McpServer)

Image

Running for a few hours (2121 instances of McpServer)

Image

I am using the createMcpHandler function as instructed and can't see anything obvious on my side that could cause this. Here is the code for reference:

https://github.com/khromov/llmctx/blob/main-custom/src/lib/mcpHandler.ts#L43C24-L43C40

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions