mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-08-01 02:06:17 -04:00
The main addition in this commit is that we hook into the Isolate's AddNearHeapLimitCallback callback and try to force the isolate to shutdown rather than letting v8 hit an OOM which would take down the entire process. In support of this, we now support a `--v8-max-heap-mb` command line option to set an explicit heap limit. As a simple way to test this feature, load a relatively heavy JS page with `--v8-max-heap-mb 1`. There's also a `--v8-flags-unsafe` which is a mechanism to pass arbitrary flags to v8 via its `SetFlagsFromString`. The parameter is called `unsafe` because some [of the many] configurable flags could conflict with how the snapshot is built and result in crashes. The snapshot creator also gains a `--v8-flags-unsafe` flag, so advance users COULD create their snapshot and run lightpanda with the same set of flags.