Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Memory Fragmentation (WIP) #386

Open
@splitice

Description

  • Version: latest / 5baab3f
  • Platform: Linux Debian ARMv7

What steps will reproduce the bug?

Long running QUIC client making regular bidirectional streams in both directions

How often does it reproduce? Is there a required condition?

24-48hrs for maximum effect

What is the expected behavior?

Memory sitting around 20-30MB (max old size of 30MB). This is the usage of the process without the QUIC server components compiled in and using TCP sockets for the same protocol in place of QUIC.

What do you see instead?

Memory peaking at 100MB+ (OOM on test device)

Additional information

QUIC (most likely ngtcp2 allocated memory) seems to create a high rate of memory fragmentation when using the default glibc malloc in real world conditions. While 100MB of ram is likely not an issue in server applications in the low-end space this is significant. Additionally as this ram is allocated with an external allocator / not v8 it is not allocated as part of the nodejs memory pool it will grow unrestricted by parameters such as max old space size.

The usage appears to be fragmentation rather than a leak, however I have not entirely ruled that out.

Currently I'm testing using jemalloc to see if it exhibits more sane behavior (results to following in coming week). Turn around time on replication means that I'll be testing this over the coming week. If it jemalloc results in sane memory usage then that supports a fragmentation situation. So far with a runtime of 2hrs this seems to be supported.

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