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

内存泄露 #47

Open
zaaack opened this issue Apr 2, 2018 · 10 comments
Open

内存泄露 #47

zaaack opened this issue Apr 2, 2018 · 10 comments

Comments

@zaaack
Copy link

zaaack commented Apr 2, 2018

image
编辑多了就会出现这种情况。

@zaaack
Copy link
Author

zaaack commented Apr 2, 2018

Full trace:

webpack: Compiling...
start compile: /Users/z/Projects/Douban/share_not/mole/src/pages/home/home-wxml.tsx
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/home-wxml.tsx page
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/home/home-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/mine/mine-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/widgets/PlayerBar/view.tsx widget
rootName this
rootName props
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/home/home-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/mine/mine-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/widgets/PlayerBar/view.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/home/home-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/pages/home/mine/mine-wxml.tsx widget
wxmlType /Users/z/Projects/Douban/share_not/mole/src/widgets/PlayerBar/view.tsx widget
compiled: /Users/z/Projects/Douban/share_not/mole/src/pages/home/home-wxml.tsx

<--- Last few GCs --->

[22511:0x103000000]  8760788 ms: Mark-sweep 1394.7 (1470.8) -> 1394.7 (1471.3) MB, 1979.2 / 0.0 ms  allocation failure GC in old space requested
[22511:0x103000000]  8762930 ms: Mark-sweep 1394.7 (1471.3) -> 1394.5 (1436.3) MB, 2140.6 / 0.0 ms  last resort
[22511:0x103000000]  8764637 ms: Mark-sweep 1394.5 (1436.3) -> 1394.5 (1434.8) MB, 1707.4 / 0.0 ms  last resort


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3b359dea9891 <JS Object>
    2: document(aka document) [/Users/z/.config/yarn/global/node_modules/@minapp/wxml-parser/dist/parser.js:~20] [pc=0x14fbd89bac6f](this=0x16491a282311 <undefined>)
    3: parse [/Users/z/.config/yarn/global/node_modules/@minapp/wxml-parser/dist/parser.js:19] [pc=0x14fbd8b044c0](this=0x3ba85514b4d1 <an Object with map 0x3730a1cac311>,xml=0xd367996c909 <String[1012]\: \n<!-- This file is genera...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewUninitializedFixedArray(int) [/usr/local/bin/node]
 5: v8::internal::(anonymous namespace)::ElementsAccessorBase<v8::internal::(anonymous namespace)::FastPackedObjectElementsAccessor, v8::internal::(anonymous namespace)::ElementsKindTraits<(v8::internal::ElementsKind)2> >::GrowCapacity(v8::internal::Handle<v8::internal::JSObject>, unsigned int) [/usr/local/bin/node]
 6: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 7: 0x14fbd470437d

@qiu8310
Copy link
Owner

qiu8310 commented Apr 2, 2018

这应该是 webpack 的问题吧,偶尔是会出现的。 我暂时无能为力哦

@zaaack
Copy link
Author

zaaack commented Apr 2, 2018

@qiu8310 但是每次报错的文件都是 minapp 里的 parser.js, 怀疑里面发生了内存泄露。

@qiu8310
Copy link
Owner

qiu8310 commented Apr 2, 2018

这样呀,那有可能,你能定位出是哪个 wxml 文件么?

那个 parser 主要是解析 wxml 文件的,是有可能出现无限循环问题

@qiu8310
Copy link
Owner

qiu8310 commented Apr 2, 2018

可能是解析 wxml 文件时造成的,你能定位出这个文件可以把这 wxml 文件发给我

@zaaack
Copy link
Author

zaaack commented Apr 2, 2018

home.wxml.zip

@zaaack
Copy link
Author

zaaack commented Apr 2, 2018

不排除是我在编辑过程中的某个状态导致的。。

@zaaack zaaack closed this as completed Apr 2, 2018
@zaaack zaaack reopened this Apr 2, 2018
@qiu8310
Copy link
Owner

qiu8310 commented Apr 2, 2018

你上面的文件是可以正常解析的,好像没问题
image

@zaaack
Copy link
Author

zaaack commented Apr 2, 2018

🤦‍♂️ 解析都是可以正常解析的,就是有时候时间一长就 oom 了,webpack 确实有内存泄露的问题,但是整个项目也不是很大,就是感觉有点频繁了..

@qiu8310
Copy link
Owner

qiu8310 commented Apr 2, 2018

一般来说,解析不成功都会报错的;而且 webpack 只会编译更新了的文件,所以我也是很奇怪。

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

No branches or pull requests

2 participants