Skip to content

[Tag Review] - Memory management #178

@etiennenoel

Description

@etiennenoel

From: w3ctag/design-reviews#1093 (comment)

The ability to manually destroy a session allows applications to free up memory without waiting for garbage collection, which can be useful since language models can be quite large.

The destroy() method seems like it would put the developer in charge of memory management. Yes, the models can be large, and use up a lot of memory. That developers can get into this situation and are forced to manage memory seems counter to how we design web APIs. Developers purposely lack a complete view of the overall state of the underlying system, how much memory a tab is using, etc. We encourage rethinking the architecture of the API so that memory management is left up to the user agent and underlying platform --- and not left to the developer to manage.

In addition, having multiple ways to destroy a session seems redundant. Please pick one (probably AbortController, it provides a lot more functionality than destroy(), which seems to just be syntactic sugar). Does it make sense to use this with JS's new "using" declaration and [Symbol.dispose]().

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