Skip to content

Documenting memory behaviours and leak detections #1518

Open
@wcandillon

Description

@wcandillon

Regarding React Native Skia and WebGPU, I have often been confused about the observable memory allocations in these libraries. But even worse, we are genuinely struggling to explain these behaviors to our clients (see #982), who believe that our libraries are leaking memory.

I think it’s fair to say that many developers, in various situations, are under the impression that Hermes is leaking memory, even though it is not.

The goal of this issue is to create a documentation page that explains the current observable memory behavior (so we can share that information with our clients) and shows how to factually check whether a library/app is leaking memory.

Is there interest in such an initiative?

Here’s a recent example: As mentioned in #982, I was under the impression that RN WebGPU was leaking memory. I spent a substantial amount of time debugging, only to confirm that all objects are eventually deleted. Yet, the allocated memory stays the same and keeps growing. The demo on iOS in dev mode goes like this:
We allocate a bunch of objects, and after a certain time, they are all deleted. However, the allocated memory in the performance monitor remains the same. In the second cycle, many more objects are allocated before deletion (thus, allocated memory increases), and this exact pattern continues, creating an almost exponential memory allocation over time.
I assumed this behavior in dev mode is "okay." However, our clients are experiencing very similar behavior, and I’m not sure what to tell them since I’m not even sure myself what’s going on.

I hope this makes sense.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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