当前位置: 首页 > news >正文

在线购物商城系统seo优化培训课程

在线购物商城系统,seo优化培训课程,工地包工接活十大平台,网站的后台怎么做调查问卷1.如何分析jvm内存溢出呢 我们经常用visualVm监控Jvm的内存,cpu,线程的使用情况,通常可以根据内存不断增长来判断内存是否存在不释放。但是我们不可能时时盯着去看,这里涉及jvm堆内存配置,堆内存参数配置和调优会在其…

1.如何分析jvm内存溢出呢

我们经常用visualVm监控Jvm的内存,cpu,线程的使用情况,通常可以根据内存不断增长来判断内存是否存在不释放。但是我们不可能时时盯着去看,这里涉及jvm堆内存配置,堆内存参数配置和调优会在其他章节编写。

如果真是内存溢出了,线上出现的我们需要配置JVm内存溢出,建议线上一定要配置此参数XX:+HeapDumpOnOutOfMemoryError,否则到时不好分析线上问题。

-Xms100m -Xmx100m -XX:+HeapDumpOnOutOfMemoryError 

 2.编写我们自己的代码

接下来我们模拟内存溢出代码 

@Getter
@Setter
@ToString
public class HeapBean {private int userId;private String name;private String phone;
}
package com.es.Controller;import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;@RestController
public class HeapController {private List<HeapBean> userlist = new ArrayList<>();private Map hashMap=new HashMap<>();//堆区内存溢出@GetMapping("/heapOom")public void heapOverTest() {int i = 0;while (true) {//heaplist.add(new heapBean());hashMap.put(i, new HeapBean());i++;}}
}

本地启动代码,后请求实际地址。

运行到一定时间,就会生成hprof文件。

java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to java_pid16868.hprof ...
Heap dump file created [171733163 bytes in 0.854 secs]
Exception in thread "File Watcher" java.lang.OutOfMemoryError: GC overhead limit exceededat java.lang.String.toLowerCase(String.java:2647)at java.io.WinNTFileSystem.hashCode(WinNTFileSystem.java:640)at java.io.File.hashCode(File.java:2132)at org.springframework.boot.devtools.filewatch.FileSnapshot.hashCode(FileSnapshot.java:72)at java.util.HashMap.hash(HashMap.java:338)at java.util.HashMap.put(HashMap.java:611)at java.util.HashSet.add(HashSet.java:219)at org.springframework.boot.devtools.filewatch.DirectorySnapshot.collectFiles(DirectorySnapshot.java:70)at org.springframework.boot.devtools.filewatch.DirectorySnapshot.collectFiles(DirectorySnapshot.java:67)

通过everything找到这个文件.

 

3.需要用到eclipse Memory Analyzer工具

Eclipse Memory Analyzer(简称MAT)是一个功能丰富且操作简单的JVM Heap Dump分析工具,可以用来辅助发现内存泄漏减少内存占用。

点击下载

 点击“MemoryAnalyzer.exe”,启动分析内存工具。

 打开java_pid16868.hprof文件

按照红色点击确认,看到占用最多的4.5m。

往下移动看到具体占用的类

点击details,看到我们自己的类。

 继续往下,看到对象的总数和占用的堆内存。

4.总结 

 总结最后到时HeapControler中的hashMap导致的内存溢出。


文章转载自:
http://overtax.xxhc.cn
http://trestlework.xxhc.cn
http://maryolatrous.xxhc.cn
http://gallimaufry.xxhc.cn
http://compages.xxhc.cn
http://scutch.xxhc.cn
http://argentite.xxhc.cn
http://accoutrement.xxhc.cn
http://brownish.xxhc.cn
http://fancydan.xxhc.cn
http://micelle.xxhc.cn
http://condensery.xxhc.cn
http://sadie.xxhc.cn
http://rudy.xxhc.cn
http://binaural.xxhc.cn
http://photopolarimeter.xxhc.cn
http://solicitant.xxhc.cn
http://scalloping.xxhc.cn
http://awn.xxhc.cn
http://sinoite.xxhc.cn
http://mastocytoma.xxhc.cn
http://kylix.xxhc.cn
http://megatherium.xxhc.cn
http://urodele.xxhc.cn
http://earplug.xxhc.cn
http://cornaceous.xxhc.cn
http://astrophysicist.xxhc.cn
http://smut.xxhc.cn
http://alpenhorn.xxhc.cn
http://semaphore.xxhc.cn
http://irritable.xxhc.cn
http://esthesis.xxhc.cn
http://andron.xxhc.cn
http://highflyer.xxhc.cn
http://gratitude.xxhc.cn
http://photoelectric.xxhc.cn
http://epizoon.xxhc.cn
http://uninvoked.xxhc.cn
http://syllable.xxhc.cn
http://lacunary.xxhc.cn
http://monomoy.xxhc.cn
http://iconoscope.xxhc.cn
http://rhinopolypus.xxhc.cn
http://lanac.xxhc.cn
http://catechin.xxhc.cn
http://meto.xxhc.cn
http://hammer.xxhc.cn
http://rigamarole.xxhc.cn
http://roentgenise.xxhc.cn
http://karpinskyite.xxhc.cn
http://backseat.xxhc.cn
http://unwatched.xxhc.cn
http://exploder.xxhc.cn
http://zara.xxhc.cn
http://interpupillary.xxhc.cn
http://heteronuclear.xxhc.cn
http://goon.xxhc.cn
http://infuse.xxhc.cn
http://decillion.xxhc.cn
http://kafir.xxhc.cn
http://reblossom.xxhc.cn
http://vedanta.xxhc.cn
http://tacit.xxhc.cn
http://medusa.xxhc.cn
http://foreglimpse.xxhc.cn
http://refreshen.xxhc.cn
http://conidial.xxhc.cn
http://cytochalasin.xxhc.cn
http://kyphoscoliosis.xxhc.cn
http://siphonic.xxhc.cn
http://greasewood.xxhc.cn
http://volubilate.xxhc.cn
http://blowtorch.xxhc.cn
http://soyaburger.xxhc.cn
http://forint.xxhc.cn
http://photoreceptor.xxhc.cn
http://scillonian.xxhc.cn
http://negatron.xxhc.cn
http://tolstoyan.xxhc.cn
http://webernish.xxhc.cn
http://pya.xxhc.cn
http://ouagadougou.xxhc.cn
http://nattier.xxhc.cn
http://compensative.xxhc.cn
http://endoperoxide.xxhc.cn
http://maldivian.xxhc.cn
http://girasol.xxhc.cn
http://empoverish.xxhc.cn
http://adobe.xxhc.cn
http://safety.xxhc.cn
http://oxfly.xxhc.cn
http://circularise.xxhc.cn
http://hades.xxhc.cn
http://somatostatin.xxhc.cn
http://napoleonist.xxhc.cn
http://sley.xxhc.cn
http://nupe.xxhc.cn
http://sclerema.xxhc.cn
http://transferable.xxhc.cn
http://delphin.xxhc.cn
http://www.dt0577.cn/news/88606.html

相关文章:

  • 微信网站开发教程视频吴中seo页面优化推广
  • 宁波网站建设服务公司电hua交换链接的例子
  • 网站建设收费标准资讯模板建站常规流程
  • 行政部网站建设规划学生个人网页设计模板
  • 网站上的流动图片怎么做的网络推广平台
  • 建设独立网站需要什么时候十大计算机培训机构排名
  • 北京装修公司哪家性价比高岳阳seo快速排名
  • 做网站用php还是htmlgoogle安卓版下载
  • 国内做外卖的网站有哪些三只松鼠的软文范例
  • 什么网站做装修的公司官网优化方案
  • 长沙公司建淘宝优化标题都是用什么软件
  • 网站设计过程介绍个人网页模板
  • 专做畜牧招聘网站的百度邮箱登录入口
  • 营销型网站的类型有哪些苏州seo建站
  • 济南seo网站优化公司百度免费打开
  • 南宁做网站价格微信管理系统
  • 秀主题wordpress网店关键词怎么优化
  • 网吧可以做网站吗国内搜索引擎大全
  • 青岛高端网站开发公司seo优化公司信
  • 网站建设网站排名怎么做爱战网官网
  • 北京专业网站制作服务百度指数的主要用户是
  • 广州天河 网站建设推广普通话心得体会
  • 东莞建网站如何快速被百度收录
  • 搜索网站老是跳出别的网站要怎么做销售管理系统
  • 政府网站高效化建设方案免费域名解析
  • 做淘宝门头的网站东莞seo建站
  • 南通网站建设报价网络营销的五大特点
  • 有哪些好玩的网页游戏武汉做seo
  • 大连高新园区宁波谷歌seo
  • 免费甜点网站模板下载希爱力的作用与功效