Skip to content

Possible memory leak #66

Closed
Closed

Description

@romgrk

If I understand correctly, transfer_buffer is re-allocated to fit the max amount of nodes ever marshalled in a single pass. I think it's never released before being re-allocated, is it possible?

(line 28)

static inline void setup_transfer_buffer(uint32_t node_count) {
uint32_t new_length = node_count * FIELD_COUNT_PER_NODE;
if (new_length > transfer_buffer_length) {
transfer_buffer_length = new_length;
transfer_buffer = static_cast<uint32_t *>(malloc(transfer_buffer_length * sizeof(uint32_t)));
auto js_transfer_buffer = ArrayBuffer::New(Isolate::GetCurrent(), transfer_buffer, transfer_buffer_length * sizeof(uint32_t));
Nan::Set(
Nan::New(module_exports),
Nan::New("nodeTransferArray").ToLocalChecked(),
Uint32Array::New(js_transfer_buffer, 0, transfer_buffer_length)
);
}
}

Activity

  1. added a commit that references this issue on Jun 16, 2020
    a76c37e
  2. added a commit that references this issue on Sep 29, 2026
    c06b0de
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