Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heap out of memory after many hours #27

Closed
deathemperor opened this issue Dec 22, 2023 · 3 comments
Closed

Heap out of memory after many hours #27

deathemperor opened this issue Dec 22, 2023 · 3 comments
Assignees
Labels

Comments

@deathemperor
Copy link

Running vite for many hours (within a workday) causes heap out of memory

<--- Last few GCs --->

[57364:0x138040000] 19512444 ms: Mark-sweep 4036.0 (4139.3) -> 4030.6 (4142.6) MB, 737.7 / 0.0 ms  (average mu = 0.461, current mu = 0.052) allocation failure; scavenge might not succeed
[57364:0x138040000] 19513801 ms: Mark-sweep 4040.6 (4144.0) -> 4035.3 (4147.0) MB, 1341.2 / 0.0 ms  (average mu = 0.226, current mu = 0.011) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

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

 1: 0x1007b3c40 node::Abort() [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]
 2: 0x1007b3e24 node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 3: 0x10090b608 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 4: 0x100ab5eec v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 5: 0x100ab4894 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 6: 0x100aa8928 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 7: 0x100aa916c v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 8: 0x100a8f0ec v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

 9: 0x100e2f80c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

10: 0x10117d04c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

11: 0x10114ee30 Builtins_CloneObjectIC [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

12: 0x10698bb68 

13: 0x101108198 Builtins_InterpreterEntryTrampoline [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

14: 0x101108198 Builtins_InterpreterEntryTrampoline [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

15: 0x101108198 Builtins_InterpreterEntryTrampoline [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

16: 0x101108198 Builtins_InterpreterEntryTrampoline [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

17: 0x101108198 Builtins_InterpreterEntryTrampoline [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]
18: 0x1068e0b38 

19: 0x101139ef4 Builtins_AsyncFunctionAwaitResolveClosure [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

20: 0x1011c8738 Builtins_PromiseFulfillReactionJob [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

21: 0x10112bc4c Builtins_RunMicrotasks [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

22: 0x1011063a4 Builtins_JSRunMicrotasksEntry [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

23: 0x100a37d38 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

24: 0x100a38228 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

25: 0x100a38404 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

26: 0x100a5eb6c v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

27: 0x100a5f308 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

28: 0x1006f8c4c node::InternalCallbackScope::Close() [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

29: 0x1006f87c4 node::InternalCallbackScope::~InternalCallbackScope() [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

30: 0x1007b7464 node::fs::FileHandle::CloseReq::Resolve() [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

31: 0x1007cdef8 node::fs::FileHandle::ClosePromise()::$_0::__invoke(uv_fs_s*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

32: 0x1007afbb0 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

33: 0x1010e42e8 uv__work_done [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

34: 0x1010e7aa4 uv__async_io [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

35: 0x1010fa058 uv__io_poll [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

36: 0x1010e7f74 uv_run [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

37: 0x1006f96e0 node::SpinEventLoop(node::Environment*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

38: 0x1007f0850 node::NodeMainInstance::Run() [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

39: 0x1007806a4 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]

40: 0x10078095c node::Start(int, char**) [/Users/deathemperor/.nvm/versions/node/v18.18.2/bin/node]
41: 0x184a010e0 start [/usr/lib/dyld]

error: "vite" exited with code 6 (SIGABRT)
@danielwaltz
Copy link
Owner

Do you feel like maybe this is related to this plugin? Looking at the output here I think it's hard to say what the source of the memory leak is. I would be inclined to think because the surface area of this plugin is relatively small compared to Vite and GraphQL Codegen (and this is just some glue between them) that it may be something to do with them.

That said, if you have any more insight that might help provide a clue or hint at it being this plugin I'm open to investigate!

@danielwaltz danielwaltz self-assigned this Jan 2, 2024
@deathemperor
Copy link
Author

I have no ideas how these memory issues are and they are normally not easy to investigate. I'm more on running vite with bun but as of today this oven-sh/bun#887 prevents it. will have to wait.

github-actions bot pushed a commit that referenced this issue Dec 1, 2024
### [3.4.1](v3.4.0...v3.4.1) (2024-12-01)

### Performance Improvements

* load and cache matches on server start ([69c1d97](69c1d97)), closes [#32](#32) [#27](#27)
* skip match cache refresh if file is generated ([c0737a7](c0737a7))

### Tests

* scope vite instances to spec directories ([90d771f](90d771f))

### Miscellaneous Chores

* **deps:** update deps ([43ed87b](43ed87b))
* **deps:** use vite 6 ([64c89c9](64c89c9))
* update dev deps ([2de28d2](2de28d2))
Copy link

github-actions bot commented Dec 1, 2024

🎉 This issue has been resolved in version 3.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants