[DISCUSS][CORE] Should managed off-heap memory take the container limit into account?
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- scala
Línea de trabajo
Empieza por UnifiedMemoryManager y la ruta de spill existente de MemoryConsumer; después revisa las lecturas de cgroup v1/v2 del prototipo y las suposiciones sobre el presupuesto de JVM/native. Un resultado útil sería una dirección aprobada por los maintainers —configuración de executor-overhead, un límite o advertencia al iniciar, o feedback en tiempo de ejecución— seguida de un reproducer y pruebas enfocados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I have been looking at how Spark managed off-heap memory behaves in a memory-limited container.
One thing that seems easy to misconfigure is that these three limits are independent:
container limit: 1500 MiB
JVM max heap: 1024 MiB
spark.memory.offHeap.size: 2048 MiB
spark.memory.offHeap.size is only an upper bound used by Spark's memory manager, so the example
above does not fail immediately. The problem is that UnifiedMemoryManager does not know about the
1500 MiB process limit. If heap, managed off-heap memory, direct buffers, thread stacks, and other
native allocations grow at the same time, the container can kill the executor before Spark gets a
chance to spill.
In that case there may be no useful Java OOM. From outside the container it can just look like:
exit code 137
OOMKilled=true
Using JVM heap occupancy as the feedback signal does not seem right here. It cannot see off-heap
or other native memory, and it moves with GC. The cgroup usage and limit describe the boundary that
actually kills the process.
I made a small prototype that reads cgroup v1/v2 values and uses them to put a lower admission
limit on Spark-managed off-heap memory. At startup the rough budget is:
cgroup limit - JVM max heap - native reserve
The admission limit can then be reduced when total cgroup usage is high. This still relies on the
existing MemoryConsumer and spill code; it does not add another eviction mechanism.
There are some non-obvious details. In particular, setting the limit to zero is not safe because a
task may fail to allocate its first sorter page and throw SparkOutOfMemoryError instead of
spilling. Also, a fixed native reserve is probably too simplistic across different collectors,
core counts, and deployment modes.
Before spending more time on the prototype, I would like to check the expected direction:
- Should Spark use the container limit when admitting managed off-heap allocations, or is this
expected to be handled entirely by executor memory-overhead configuration? - If Spark should handle it, would a startup warning/static cap be preferable to runtime
cgroup-pressure feedback?
If this belongs in Spark Core, I can follow up with a focused reproducer and tests for the approach
maintainers prefer.
- Lenguaje dominante
- Scala
- Estrellas
- 44.2k
- Forks
- 29.5k
- Merge medio
- 8 h 43 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/spark
-
[BUILD] Bump Ivy up to 2.6.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 2 días
-
[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterablePosiblemente ocupada @zainmirzaaa la tomó hace 61 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[CORE] bug report: collision of resource profile idPosiblemente ocupada @ybapat la tomó hace 86 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
apache/spark#57498 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[BUILD] Drop oro dependencyAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/spark#57209 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
apache/spark#59659 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/spark
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
containerbase/base#7891 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 91/100
com-vitthalmirji/toon4s#117 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zio/zio-blocks#1780 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
digital-asset/participant-query-store#168 ·
Los mantenedores suelen responder en 1 día