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

Memory leak on Sapper dev (watch mode) #71

Closed
axmad386 opened this issue Mar 27, 2021 · 3 comments
Closed

Memory leak on Sapper dev (watch mode) #71

axmad386 opened this issue Mar 27, 2021 · 3 comments

Comments

@axmad386
Copy link

I use this component on sapper, this editor is awesome. But I think there is something wrong.

  1. When I start Sapper on dev mode sapper dev, first this warning occure Error when building project #41. Program still working like normal.
  2. Then when I make some change to svelte component and Sapper doing the hot reload, my application is break due to high memory usage
<--- Last few GCs --->

[24940:0x1045f1000]   371975 ms: Mark-sweep 2039.0 (2051.8) -> 2038.8 (2052.3) MB, 2066.6 / 0.0 ms  (average mu = 0.116, current mu = 0.011) allocation failure scavenge might not succeed
[24940:0x1045f1000]   374597 ms: Mark-sweep 2039.4 (2052.3) -> 2039.2 (2052.5) MB, 2610.9 / 0.0 ms  (average mu = 0.056, current mu = 0.004) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10123d2a5 node::Abort() (.cold.1) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 2: 0x10009dd29 node::Abort() [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 3: 0x10009de8f node::OnFatalError(char const*, char const*) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 4: 0x1001d9db7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 5: 0x1001d9d57 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 6: 0x10036c885 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 7: 0x10036e11a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 8: 0x10036a075 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
 9: 0x100367afe v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
10: 0x100374e3a v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
11: 0x100374ec1 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
12: 0x1003412a7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
13: 0x1006a7be8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
14: 0x1009f3899 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/axmad386/.nvm/versions/node/v14.4.0/bin/node]
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

PS: node is still running on port 3000 (sapper default port), and I must force kill that port to re run my sapper application 😢

@pd4d10
Copy link
Owner

pd4d10 commented Apr 4, 2021

It seems to be an issue of sapper (or its build deps)

@axmad386
Copy link
Author

axmad386 commented Apr 5, 2021

how i can destroy this component by program? May be I can include it on svelte onDestroy lifecycle for workaround

@pd4d10
Copy link
Owner

pd4d10 commented Nov 21, 2021

how i can destroy this component by program

It's supposed to be a Svelte component, so it will automatically be destroyed once removed from the component tree.

Since Sapper is discontinued, we provide an example of its successor SvelteKit. Let's track it in #96

@pd4d10 pd4d10 closed this as completed Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants