Skip to content

Svelte benchmark project #270

@no-mrwaip

Description

@no-mrwaip

Describe the bug

Hi, I decided to test rolldown vite on a fresh project. I generated a lot of icons and similar pages consisting of different components.

And by default, the project crashes due to lack of memory. I would like to know if this is due to the svelte plugin or if there is some kind of bug in rolldown.

 npm run build

> [email protected] build
> vite build

rolldown-vite v6.3.21 building SSR bundle for production...
transforming (1) node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte
<--- Last few GCs --->

[56332:0x130008000]    12474 ms: Scavenge 4052.2 (4133.5) -> 4049.8 (4134.8) MB, pooled: 0 MB, 6.38 / 0.00 ms  (average mu = 0.314, current mu = 0.158) allocation failure; 
[56332:0x130008000]    12491 ms: Scavenge 4053.3 (4134.8) -> 4052.0 (4154.5) MB, pooled: 0 MB, 16.46 / 0.00 ms  (average mu = 0.314, current mu = 0.158) allocation failure; 

In order for the assembly to work, the memory size had to be increased

NODE_OPTIONS=--max-old-space-size=8096 vite build

Reproduction

https://github.com/no-mrwaip/svelte-rolldown

Steps to reproduce

clone https://github.com/no-mrwaip/svelte-rolldown
npm ci
npm run build

System Info

System:
    OS: macOS 15.5
    CPU: (8) arm64 Apple M1
    Memory: 3.69 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.nvm/versions/node/v22.13.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.13.0/bin/npm
    pnpm: 8.6.6 - /opt/homebrew/bin/pnpm
  Browsers:
    Brave Browser: 131.1.73.101
    Chrome: 137.0.7151.104
  npmPackages:
    rolldown-vite:  6.3.21

Used Package Manager

npm

Logs

 npm run build

> [email protected] build
> vite build

rolldown-vite v6.3.21 building SSR bundle for production...
transforming (1) node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte
<--- Last few GCs --->

[56332:0x130008000]    12474 ms: Scavenge 4052.2 (4133.5) -> 4049.8 (4134.8) MB, pooled: 0 MB, 6.38 / 0.00 ms  (average mu = 0.314, current mu = 0.158) allocation failure; 
[56332:0x130008000]    12491 ms: Scavenge 4053.3 (4134.8) -> 4052.0 (4154.5) MB, pooled: 0 MB, 16.46 / 0.00 ms  (average mu = 0.314, current mu = 0.158) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x100d891fc node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 2: 0x100fb4704 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 3: 0x10119e9a4 v8::internal::Heap::stack() [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 4: 0x10119cdb0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 5: 0x101191aec v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 6: 0x101192328 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 7: 0x101174da4 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 8: 0x101578168 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
 9: 0x1019f9af4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
10: 0x101967ca8 Builtins_GrowFastSmiOrObjectElements [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
11: 0x108866310 
12: 0x10886c214 
13: 0x10886143c 
14: 0x1019a1290 Builtins_AsyncFunctionAwaitResolveClosure [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
15: 0x101a6c4d8 Builtins_PromiseFulfillReactionJob [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
16: 0x101991594 Builtins_RunMicrotasks [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
17: 0x101962af4 Builtins_JSRunMicrotasksEntry [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
18: 0x1010fa6e8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
19: 0x1010faf8c v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
20: 0x1010fb0c4 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
21: 0x101125c70 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
22: 0x101126454 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
23: 0x100ca5994 node::InternalCallbackScope::Close() [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
24: 0x100ca5454 node::InternalCallbackScope::~InternalCallbackScope() [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
25: 0x100d809d4 node::fs::FSReqPromise<node::AliasedBufferBase<double, v8::Float64Array>>::Reject(v8::Local<v8::Value>) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
26: 0x100d8f9c4 node::fs::FSReqAfterScope::Reject(uv_fs_s*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
27: 0x100d8fbe8 node::fs::AfterNoArgs(uv_fs_s*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
28: 0x100d816d4 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
29: 0x10193eddc uv__work_done [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
30: 0x101942900 uv__async_io [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
31: 0x1019562f4 uv__io_poll [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
32: 0x101942e98 uv_run [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
33: 0x100ca64e4 node::SpinEventLoopInternal(node::Environment*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
34: 0x100dd0628 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
35: 0x100dd03c4 node::NodeMainInstance::Run() [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
36: 0x100d46f88 node::Start(int, char**) [/Users/mrwaip/.nvm/versions/node/v22.13.0/bin/node]
37: 0x19a46eb98 start [/usr/lib/dyld]
zsh: abort      npm run build

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions