From d917f676aa506a31b791f8c91f667e8611329825 Mon Sep 17 00:00:00 2001 From: Cody Gunton Date: Wed, 5 Jul 2023 11:01:11 +0200 Subject: [PATCH] fix: Avoid bb.js memory issues. (https://github.com/AztecProtocol/barretenberg/pull/578) --- .../cpp/src/barretenberg/common/slab_allocator.cpp | 13 +------------ .../polynomial_store/polynomial_store_cache.cpp | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp index c5e678b9fb5..ea260389005 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp @@ -103,18 +103,7 @@ void SlabAllocator::init(size_t circuit_size_hint) // 1; // Miscellaneous. // /* 6 MiB */ prealloc_num[base_size * 12] = 2 + // next_var_index, prev_var_index // 2; // real_variable_index, real_variable_tags - /* 16 MiB */ prealloc_num[base_size * 32] = 11 + // Composer base selector vectors. - 4 + // Monomial wires. - 4 + // Lagrange wires. - 15 + // Monomial constraint selectors. - 15 + // Lagrange constraint selectors. - 8 + // Monomial perm selectors. - 8 + // Lagrange perm selectors. - 1 + // Monomial sorted poly. - 5 + // Lagrange sorted poly. - 2 + // Perm poly. - 4; // Quotient poly. - // 8; // Miscellaneous. + /* 16 MiB */ prealloc_num[base_size * 32] = 11; // Composer base selector vectors. /* 32 MiB */ prealloc_num[base_size * 32 * 2] = 1; // Miscellaneous. /* 50 MiB */ prealloc_num[base_size * 32 * 3] = 1; // Variables. /* 64 MiB */ prealloc_num[base_size * 32 * 4] = 1 + // SRS monomial points. diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_cache.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_cache.cpp index aae5a205377..5d06bdbb41a 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_cache.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_cache.cpp @@ -3,7 +3,7 @@ namespace proof_system { PolynomialStoreCache::PolynomialStoreCache() - : max_cache_size_(70) + : max_cache_size_(40) {} PolynomialStoreCache::PolynomialStoreCache(size_t max_cache_size)