8000 Throw exception when text encode alloc memory fail. · Issue #334 · whatwg/encoding · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Throw exception when text encode alloc memory fail. #334
Open
@xu-ms

Description

@xu-ms

What is the issue with the Encoding Standard?

In Edge and Chrome, we have found that TextEncoder Encoding Standard (whatwg.org) may encounter OOM (Out of Memory) errors when encode text, not only due to large memory allocation but also for some unknown reasons.
Our current strategy is to crash the renderer process. We now want to optimize this behavior by throwing an exception when memory allocation fails.

I tested encode with a long string in Firefox and Safari browsers.
Firefox will throw a exception "out of memory".
image
Safari will return a empty UInt8Array.

I noticed that the current standards do not define how to handle OOM (Out of Memory) situations.Do we need to establish such a standard?

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

      0