Memory and Execution Limits#

VlConvert runs Vega and Vega-Lite in V8 JavaScript workers. Two converter settings bound that work:

  • max_v8_heap_size_mb caps the JavaScript heap of each worker. The minimum accepted value is 64 MB.

  • max_v8_execution_time_secs stops JavaScript execution after the given number of seconds.

Both are unlimited by default. Set them when specifications are untrusted or when a service needs predictable failure boundaries. A conversion that hits either limit fails, and later conversions continue normally.

These settings do not cap the whole process. Decoded images, fonts, raster buffers, PDF generation, and other native allocations live outside the JavaScript heap. Use operating-system or container limits as an outer boundary on these if needed.

Size the Worker Pool#

Each persistent worker has its own JavaScript runtime and heap. More workers allow more concurrent conversions but raise baseline and peak memory usage.

gc_after_conversion asks the JavaScript engine to collect garbage after every conversion. It can reduce the heap retained between requests at the cost of throughput.

A CLI conversion runs in a short-lived process, so heap and execution-time limits are more useful than post-conversion garbage collection. This example uses chart.vl.json from Quick Start:

$ vl-convert \
>   --max-v8-heap-size-mb 512 \
>   --max-v8-execution-time-secs 10 \
>   vl2png --input chart.vl.json --output chart.png