Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: patch jsii-rosetta to limit the number of worker threads (#14389)
jsii-rosetta uses multiple worker threads by default to speed up sample extraction. It defaults to spawning workers equal to half the number of cores. On extremely powerful build machines (e.g., CodeBuild X2_LARGE compute with 72 vCPUs), the high number of workers (36) results in thrash and high memory usage due to duplicate loads of source files. This was causing the v2 builds to fail with: "FATAL ERROR: NewSpace::Rebalance Allocation failed - JavaScript heap out of memory" The patch simply limits the top number of worker threads to an arbitrarily-chosen maximum limit of 16. We could simply disable the worker threads, but this takes much longer to process. With single-threading, rosetta takes ~35 minutes to extract samples from the CDK; with 16 workers, it takes ~3.5 minutes. I absolutely want to find the proper way to backfeed this into rosetta, but opting for the simple patch approach at the moment because our v2 builds have been blocked for about a week already. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information