dcloudio / uni-app

A cross-platform framework using Vue.js
https://uniapp.dcloud.io
Apache License 2.0
40.14k stars 3.63k forks source link

在Archlinux下编译占用25G内存和100%cpu的问题 #2754

Closed ystyle closed 10 months ago

ystyle commented 3 years ago

问题描述 [问题描述:尽可能简洁清晰地把问题描述清楚] 创建项目(cli模式,默认模板),启动本地h5服务模式, 然后等一下就会发现系统占用満了,然后系统假死。

复现步骤 [复现问题的步骤]

  1. 启动 'yarn run serve'

[或者可以直接贴源代码]

预期结果 [使用简洁清晰的语言描述你希望生效的预期结果] 编译占用减少

实际结果 [这里请贴上你的报错截图或文字] 2021-07-13_15-04

系统信息:

 ystyle@Archlinux  ~/Work/tkh/tkh-acs-mp   master ●✚  npm run info

> tkh-face-mp@0.1.0 info /home/ystyle/Work/tkh/tkh-acs-mp
> node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js

uni-app v3.1.18
uni-app cli v2.0.0-31920210609001

Environment Info:

  System:
    OS: Linux 5.12 Arch Linux undefined
    CPU: (12) x64 Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.16.1/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @dcloudio/types: * => 2.2.18 
    @dcloudio/uni-app-plus: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-app-plus-nvue:  0.0.1 
    @dcloudio/uni-app-plus-nvue-v8:  0.0.1 
    @dcloudio/uni-automator: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-cli-shared: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-h5: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-helper-json: * => 1.0.13 
    @dcloudio/uni-i18n: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-migration: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-360: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-alipay: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-baidu: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-kuaishou: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-qq: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-toutiao: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-vue: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-mp-weixin: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-quickapp-native: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-quickapp-webview: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-stat: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/uni-template-compiler: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/vue-cli-plugin-uni: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/webpack-uni-mp-loader: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @dcloudio/webpack-uni-nvue-loader:  0.0.1 
    @dcloudio/webpack-uni-pages-loader: ^2.0.0-31920210609001 => 2.0.0-31920210609001 
    @hap-toolkit/dsl-vue:  0.6.13 
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.6 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.13 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  4.5.13 
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-router:  4.5.13 
    @vue/cli-plugin-vuex:  4.5.13 
    @vue/cli-service: ~4.5.0 => 4.5.13 
    @vue/cli-shared-utils:  4.5.13 
    @vue/component-compiler-utils:  3.2.2 (3.2.2)
    @vue/preload-webpack-plugin:  1.1.2 
    @vue/shared: ^3.0.0 => 3.1.4 
    @vue/web-component-wrapper:  1.3.0 
    mpvue-page-factory:  1.0.1 
    mpvue-template-compiler:  1.0.13 
    uni-h5-vue:  2.6.10 
    uni-mp-vue:  2.6.10 
    vue: ^2.6.11 => 2.6.14 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.7 (16.3.0, 15.9.7)
    vue-router:  3.0.1 
    vue-style-loader:  4.1.3 (4.1.3)
    vue-template-compiler: ^2.6.11 => 2.6.14 (2.6.14)
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.2.0 => 3.6.2 
    vuex-persistedstate: ^3.2.0 => 3.2.0 
  npmGlobalPackages:
    @vue/cli: Not Found
ystyle@Archlinux  ~/Code/Docker/ergo/data  neofetch 
                   -`                    ystyle@Archlinux 
                  .o+`                   ---------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: XPS 13 7390 
               `+oooooo:                 Kernel: 5.12.14-arch1-1 
               -+oooooo+:                Uptime: 8 days, 4 hours, 21 mins 
             `/:-:++oooo+:               Packages: 1614 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.8 
           `/++++++++++++++:             Resolution: 1920x1080 
          `/+++ooooooooooooo/`           DE: Plasma 5.22.2 
         ./ooosssso++osssssso+`          WM: KWin 
        .oossssso-````/ossssss+`         WM Theme: Breeze 
       -osssssso.      :ssssssso.        Theme: Breeze Dark [Plasma], Breeze [GTK2/3] 
      :osssssss/        osssso+++.       Icons: breeze-dark [Plasma], breeze-dark [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: terminator 
   `/ossssso+/:-        -:/+osssso+-     CPU: Intel i7-10710U (12) @ 4.700GHz 
  `+sso+:-`                 `.-/+oso:    GPU: Intel Comet Lake UHD Graphics 
 `++:.                           `-/+/   Memory: 7452MiB / 15697MiB 
 .`                                 `/

补充信息 [可选] [根据你的分析,出现这个问题的原因可能在哪里?] 编译占用完了系统cpu和内存

DudeHu commented 3 years ago

i have the same problem,when i run 'npm run build' in linux os, the usage of cpu is too high

LibreGML commented 5 months ago

你们是怎么在 arch linux 用的 HbuilderX,用 wine 吗

ystyle commented 5 months ago

你们是怎么在 arch linux 用的 HbuilderX,用 wine 吗

用命令行版本创建项目就好了

Otto-J commented 5 months ago

本帖时间较久,不明确是否还可以复现,uni-app 项目本质上还是一个 vue-cli/vite 对应(vue2/vue3)项目工程,。如有问题还请开新贴讨论,并补充相关复现步骤。