Detecting memory leaks through shared function context

Abierto
#281 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript, nodejs

Línea de trabajo

Start with the linked diagnostics-summit document and the heap-snapshot reconstruction approach described here; no repository files or tests are named. Establish how heap snapshots can identify objects retained by a shared function context, and define a reproducible result that demonstrates the detected pattern.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

blind-spot never stale

This was discussed at the diagnostics summit, and I want to take the discussion here. The document I referred to is this, by my colleague @jakobkummerow.

The gist of the problem is:

const f = (function() {
  let a = {};
  let b = {};
  let c = ()=>a;  // forces a to be context-allocated.
  let d = ()=>b;  // forces b to be context-allocated.
  return d;  // the function context escapes and is kept alive.
})();

The object assigned to a is no longer accessible though JavaScript, but is kept alive because it is allocated onto the same context as b, which remains accessible through d.

Detecting this pattern at runtime would require the VM to keep track of additional meta-data, which does not pay off. However, we could, based on the information from a heap snapshot reconstruct missing metadata and detect this pattern.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
550
Forks
69
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nodejs/diagnostics

Todos los issues de nodejs/diagnostics

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.