Skip to content

Worker: log main thread memory usage on claim #1101

Closed

Description

@josephjclark

Each time the worker claims, we should log the % memory used by the main thread.

This doesn't include any usage by the child processes in the engine/runs. It just tells you what's up in the worker.

I think we need this:

const { total_heap_size, used_heap_size}  = v8.getHeapStatistics();
console.log(`memory usage: ${used_heap_size} / ${total_heap_size} (%)`)

Later, we can decide what to do if memory is low. Should we alert? Should we force a restart?

We might consider polling this.

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

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions