小编Die*_*ade的帖子

随着时间的推移,Angular 4变得越来越慢

我有一个角度4.3.5应用程序,它使用一段时间后变得更慢(约20分钟).

我的情景如下:

  • 在RaspberryPi B 3上运行的Rest API和静态角度html/css/js
  • ~30 RaspberryPI B 3通过Chromium(版本58和60)访问静态角度应用

发生了什么:

  • Angular的HTTP请求在时间过后变慢.示例:从~100 ms到~2秒

附加信息:

  • 如果我在Chromium上按F5,Angular应用程序将恢复正常
  • Angular使用此模板https://themeforest.net/item/primer-angular-2-material-design-admin-template/19228165
  • Angular使用我编写的Google Chrome/Chromium应用程序,通过串口与Arduino进行通信(Chrome API:chrome.runtime.sendMessage,chrome.runtime.connect和chrome.serial)
  • 当应用程序变慢时,客户端RaspberryPi具有可用资源(CPU和内存)
  • Angular应用程序几乎不存储浏览器

提出问题的组件如下:

import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import 'rxjs/add/operator/takeUntil';
import { Subject } from 'rxjs/Subject';

import { SweetAlertService } from 'ng2-cli-sweetalert2';

import { ApiService } from '.././api.service';
import { NFCService } from '.././nfc.service';

@Component({
  selector: 'app-menu',
  templateUrl: './menu.component.html',
  styleUrls: ['./menu.component.scss']
})
export class MenuComponent implements OnInit, OnDestroy {

  private …
Run Code Online (Sandbox Code Playgroud)

google-chrome raspberry-pi angular

18
推荐指数
1
解决办法
5691
查看次数

标签 统计

angular ×1

google-chrome ×1

raspberry-pi ×1