??xml version="1.0" encoding="utf-8" standalone="yes"?>快乐双彩交流群:BlogJava - 快乐十分精确公式//www.giqrs.com/all专注于Java技?/description>zh-cnThu, 25 Apr 2019 06:02:00 GMTThu, 25 Apr 2019 06:02:00 GMT60百度APP移动端网络深度优化实践分??:网络连接优化篇 - 快乐十分精确公式//www.giqrs.com/jb2011/archive/2019/04/24/433730.htmlJack JiangJack JiangWed, 24 Apr 2019 08:25:00 GMT//www.giqrs.com/jb2011/archive/2019/04/24/433730.html//www.giqrs.com/jb2011/comments/433730.html//www.giqrs.com/jb2011/archive/2019/04/24/433730.html#Feedback0//www.giqrs.com/jb2011/comments/commentRss/433730.html//www.giqrs.com/jb2011/services/trackbacks/433730.html阅读全文

Jack Jiang 2019-04-24 16:25 发表评论
]]>
百度APP移动端网络深度优化实践分?一):DNS优化?/title><link>//www.giqrs.com/jb2011/archive/2019/04/22/433729.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Mon, 22 Apr 2019 05:51:00 GMT</pubDate><guid>//www.giqrs.com/jb2011/archive/2019/04/22/433729.html</guid><wfw:comment>//www.giqrs.com/jb2011/comments/433729.html</wfw:comment><comments>//www.giqrs.com/jb2011/archive/2019/04/22/433729.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/jb2011/comments/commentRss/433729.html</wfw:commentRss><trackback:ping>//www.giqrs.com/jb2011/services/trackbacks/433729.html</trackback:ping><description><![CDATA[     摘要: 本文由百度技术团?#8220;蔡锐”原创发表?#8220;百度App技?#8221;公众号,原题为《百度App网络深度优化系列《一》DNS优化》,感谢原作者的无私分享。一、前言网络优化是客户端几大技术方向中公认的一个深度领域,所以百度App给大家带来网络深度优化系列文章。本系列文章目录如下:《百度APP移动端网络深度优化实践分?一):DNS优化篇》(* 本文)《百度APP移动?..  <a href='//www.giqrs.com/jb2011/archive/2019/04/22/433729.html'>阅读全文</a><img src ="//www.giqrs.com/jb2011/aggbug/433729.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/jb2011/" target="_blank">Jack Jiang</a> 2019-04-22 13:51 <a href="//www.giqrs.com/jb2011/archive/2019/04/22/433729.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>性能问题定位:工具使用【转?/title><link>//www.giqrs.com/xiaomage234/archive/2019/04/19/433725.html</link><dc:creator>小马?/dc:creator><author>小马?/author><pubDate>Fri, 19 Apr 2019 03:04:00 GMT</pubDate><guid>//www.giqrs.com/xiaomage234/archive/2019/04/19/433725.html</guid><wfw:comment>//www.giqrs.com/xiaomage234/comments/433725.html</wfw:comment><comments>//www.giqrs.com/xiaomage234/archive/2019/04/19/433725.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/xiaomage234/comments/commentRss/433725.html</wfw:commentRss><trackback:ping>//www.giqrs.com/xiaomage234/services/trackbacks/433725.html</trackback:ping><description><![CDATA[from:<a >//zhulongchao.com/blog/performance-trace.html<br /><br /><h2 class="zxao">1.网速测?/h2><h3>安装iperf</h3><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">yum install epel-release 从epel源中安装 yum install -y iperf </code></pre></div></div><h3>带宽检?/h3><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">iperf -s 开启服务端 iperf -c ip </code></pre></div></div><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><img src="//images.cnblogs.com/cnblogs_com/zhulongchao/771893/o_iperf.png" alt="" style="margin: 1.5em auto 1.6em; box-sizing: border-box; padding: 0px; max-width: 100%; display: block; height: auto;" /></p><h3>丢包问题</h3><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">tcpdump进行抓包 tcpdump -i eth0 -s 3000 port 8080 -w /home/tomcat.pcap 对于抓包文件采用wireshark进行分析 丢包(TCP DUP ACK) 重传(retransmission),超时重传, </code></pre></div></div><h2 class="zxao">2.cdn性能测试</h2><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">cdn 缓存,回源问? 304请求,浏览器是否使用本地缓存。比较last_modified 和if_modified_since 通过实践戳来判断,浏览器缓存和cdn缓存 </code></pre></div></div><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><img src="//img4.tbcdn.cn/L1/461/1/2118052340.jpg" alt="" style="margin: 1.5em auto 1.6em; box-sizing: border-box; padding: 0px; max-width: 100%; display: block; height: auto;" /></p><h2 class="zxao">3.DNS基础</h2><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">路由解析</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">泛域名解?/p><h2 class="zxao">4.分布式服务链路追?/h2><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><img src="//images.cnblogs.com/cnblogs_com/zhulongchao/771893/o_traceid.png" alt="" style="margin: 1.5em auto 1.6em; box-sizing: border-box; padding: 0px; max-width: 100%; display: block; height: auto;" /></p><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">http入口产生一个traceId 分发到rpc调用,cache,db,jms调用链路? google的著名论文dapper和zipkin 日志聚合,绑定链路日志和业务日志 采样采集,慢请求,异常服务? 日志量大。日志异步写入,环状数组,日志组件自? 共享信息放在ThreadLocal中。比如traceId </code></pre></div></div><h2 class="zxao">5.网卡性能问题定位</h2><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">tsar -l -i 1 --traffic 查看网卡的进出流?</code></pre></div></div><h2 class="zxao">6.CPU性能问题定位</h2><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">tsar -l -i 1 --cpu 软件问题定位,perf 采样所有进程数? perf record -F 99 -a -g -- sleep 30 java进程的函数map:java -cp attach-main.jar:$JAVA_HOME/lib/tools.jar net.virtualvoid.perf.AttachOnce PID 输出函数和地址的map 输出火焰?perf script | stackcollapse-perf.pl | flamegraph.pl --color=java --hash > flamegraph.svg </code></pre></div></div><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><img src="//images.cnblogs.com/cnblogs_com/zhulongchao/771893/o_QQ%e6%88%aa%e5%9b%be20170724162019.png" alt="" style="margin: 1.5em auto 1.6em; box-sizing: border-box; padding: 0px; max-width: 100%; display: block; height: auto;" /></p><h2 class="zxao">7.内存性能问题定位</h2><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">-堆内内存问题?/p><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">采用jmap dump内存,采用离线工具分? jprofile、mat </code></pre></div></div><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">-堆外内存问题</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">a.google-perftools</p><div style="margin: 0px; box-sizing: border-box; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="margin: 0px; box-sizing: border-box; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><pre style="margin-top: 0px; margin-bottom: 10px; box-sizing: border-box; padding: 9.5px; background: #f5f5f5; font-size: 0.8rem; line-height: 1.42857; border-radius: 4px; border: 1px solid #cccccc; color: #333333; word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap; font-family: Consolas, "Liberation Mono", Courier, monospace;"><code style="margin: 0px auto; box-sizing: border-box; padding: 0px 0.2em; max-width: 760px; width: 739px; display: block; font-size: 0.8rem; background-color: #f4f4f4; border: none; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; border-radius: 4px; line-height: 21.76px;">yum install -y google-perftools graphviz export LD_PRELOAD=/usr/lib64/libtcmalloc.so.4 export HEAPPROFILE=/home/testGperf.prof 执行程序,结束程序,生成prof 分析prof 生成svg, pdf,text pprof --svg $JAVA_HOME/bin/java testGperf.prof.0001.heap > test.svg pprof --pdf $JAVA_HOME/bin/java testGperf.prof.0001.heap > test.pdf pprof --text $JAVA_HOME/bin/java testGperf.prof.0001.heap > test.txt </code></pre></div></div><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">b.jemalloc定位(优势,适合长时间trace?/p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><img src="//images.cnblogs.com/cnblogs_com/zhulongchao/771893/o_QQ%e6%88%aa%e5%9b%be20170724161232.png" alt="" style="margin: 1.5em auto 1.6em; box-sizing: border-box; padding: 0px; max-width: 100%; display: block; height: auto;" /></p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">sudo apt-get install graphviz 编译安装 ./configure –enable-prof –enable-stats –enable-debug –enable-fill make make install</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">运行配置 export MALLOC_CONF=”prof:true,prof_gdump:true,prof_prefix:/home/jedump/jez,lg_prof_interval:30,lg_prof_sample:17”</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">export LD_PRELOAD=/usr/local/lib/libjemalloc.so.2 运行 java -jar target/spring-boot-jemalloc-example-0.0.1-SNAPSHOT.jar</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">jeprof –show_bytes –svg jez.*.heap > app-profiling.svg</p><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">注明:如果在docker容器中,推荐用pprof,jemalloc只显示函数地址,不显示函数?/p><h2 class="zxao">8.机器资源配额问题</h2><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">/etc/security/limits.conf</p><ul style="margin: 0px 0px 0px 20px; box-sizing: border-box; padding: 0px; font-size: 0.9rem; text-align: justify; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;"><li style="margin: 0px; box-sizing: border-box; padding: 0px;">soft nofile 65536</li><li style="margin: 0px; box-sizing: border-box; padding: 0px;">hard nofile 65536</li></ul><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">控制该用户文件句柄数</p><h2 class="zxao">9.磁盘性能问题定位</h2><p style="margin: 20px 0px; box-sizing: border-box; padding: 0px; text-align: justify; font-size: 0.9rem; color: #222222; font-family: Georgia, "Linux Libertine", -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; background-color: #ffffff;">tsar -l -i 1 –io</p></a><img src ="//www.giqrs.com/xiaomage234/aggbug/433725.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/xiaomage234/" target="_blank">小马?/a> 2019-04-19 11:04 <a href="//www.giqrs.com/xiaomage234/archive/2019/04/19/433725.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Flowable6.6.0开发路线图?0190418?/title><link>//www.giqrs.com/ouyida3/archive/2019/04/18/433722.html</link><dc:creator>ouyida3</dc:creator><author>ouyida3</author><pubDate>Thu, 18 Apr 2019 01:07:00 GMT</pubDate><guid>//www.giqrs.com/ouyida3/archive/2019/04/18/433722.html</guid><wfw:comment>//www.giqrs.com/ouyida3/comments/433722.html</wfw:comment><comments>//www.giqrs.com/ouyida3/archive/2019/04/18/433722.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/ouyida3/comments/commentRss/433722.html</wfw:commentRss><trackback:ping>//www.giqrs.com/ouyida3/services/trackbacks/433722.html</trackback:ping><description><![CDATA[     摘要: 21天前,增加了6.6.0的路线图,主要是DMN?<br>同时?.5.0有点延迟了?nbsp; <a href='//www.giqrs.com/ouyida3/archive/2019/04/18/433722.html'>阅读全文</a><img src ="//www.giqrs.com/ouyida3/aggbug/433722.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/ouyida3/" target="_blank">ouyida3</a> 2019-04-18 09:07 <a href="//www.giqrs.com/ouyida3/archive/2019/04/18/433722.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> 4年前端?年CTO:一个非科班程序员的真实奋斗?/title><link>//www.giqrs.com/jb2011/archive/2019/04/15/433720.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Mon, 15 Apr 2019 03:45:00 GMT</pubDate><guid>//www.giqrs.com/jb2011/archive/2019/04/15/433720.html</guid><wfw:comment>//www.giqrs.com/jb2011/comments/433720.html</wfw:comment><comments>//www.giqrs.com/jb2011/archive/2019/04/15/433720.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/jb2011/comments/commentRss/433720.html</wfw:commentRss><trackback:ping>//www.giqrs.com/jb2011/services/trackbacks/433720.html</trackback:ping><description><![CDATA[     摘要: 1、引言我,Scott,一家创业公司的 CTO。从?年却很少写文章,近一年来接触了几十个刚毕业的前端新人,也面试?00多个前端工程师和Nodejs工程师,对于前端发展的这个职业算是有些感触吧,打算陆续写一些从业经验也好,技术分享也好,对自己前6年的经历做一些文字上的沉淀。此篇文章谨献给工作0 ~ 3年的前端工程师,内容都是我的亲身经历,不精彩但接地气。(本文同步发布于://www.5...  <a href='//www.giqrs.com/jb2011/archive/2019/04/15/433720.html'>阅读全文</a><img src ="//www.giqrs.com/jb2011/aggbug/433720.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/jb2011/" target="_blank">Jack Jiang</a> 2019-04-15 11:45 <a href="//www.giqrs.com/jb2011/archive/2019/04/15/433720.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>将博客搬至CSDN - 快乐十分精确公式//www.giqrs.com/lhbjava/archive/2019/04/14/433719.html林的林的Sun, 14 Apr 2019 06:57:00 GMT//www.giqrs.com/lhbjava/archive/2019/04/14/433719.html//www.giqrs.com/lhbjava/comments/433719.html//www.giqrs.com/lhbjava/archive/2019/04/14/433719.html#Feedback0//www.giqrs.com/lhbjava/comments/commentRss/433719.html//www.giqrs.com/lhbjava/services/trackbacks/433719.html将博客搬至CSDN

林的 2019-04-14 14:57 发表评论
]]>
不为人知的网络编??:从数据传输层深度解密HTTP - 快乐十分精确公式//www.giqrs.com/jb2011/archive/2019/04/13/433717.htmlJack JiangJack JiangSat, 13 Apr 2019 03:27:00 GMT//www.giqrs.com/jb2011/archive/2019/04/13/433717.html//www.giqrs.com/jb2011/comments/433717.html//www.giqrs.com/jb2011/archive/2019/04/13/433717.html#Feedback0//www.giqrs.com/jb2011/comments/commentRss/433717.html//www.giqrs.com/jb2011/services/trackbacks/433717.html阅读全文

Jack Jiang 2019-04-13 11:27 发表评论
]]>
一篇读懂HTTPS:加密原理、安全逻辑、数字证书等 - 快乐十分精确公式//www.giqrs.com/jb2011/archive/2019/04/08/433708.htmlJack JiangJack JiangMon, 08 Apr 2019 03:48:00 GMT//www.giqrs.com/jb2011/archive/2019/04/08/433708.html//www.giqrs.com/jb2011/comments/433708.html//www.giqrs.com/jb2011/archive/2019/04/08/433708.html#Feedback0//www.giqrs.com/jb2011/comments/commentRss/433708.html//www.giqrs.com/jb2011/services/trackbacks/433708.html阅读全文

Jack Jiang 2019-04-08 11:48 发表评论
]]>
微同商城使用私库解决打包编译问题 - 快乐十分精确公式//www.giqrs.com/sdyjmc/archive/2019/04/04/433704.html单飞单飞Thu, 04 Apr 2019 01:36:00 GMT//www.giqrs.com/sdyjmc/archive/2019/04/04/433704.html//www.giqrs.com/sdyjmc/comments/433704.html//www.giqrs.com/sdyjmc/archive/2019/04/04/433704.html#Feedback0//www.giqrs.com/sdyjmc/comments/commentRss/433704.html//www.giqrs.com/sdyjmc/services/trackbacks/433704.html微同商城 搭建私服
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project platform: Failed to deploy artifacts: Could n
ot find artifact com.platform:platform:pom:1.0.0 in releases(//nkf:
8081/repository/xiaowang-host/) -> [Help 1]

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.platform</groupId>
    <artifactId>platform</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <description>platform</description>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project platform: Deployment failed: repository eleme
nt was not specified in the POM inside distributionManagement element or in -Dal
tDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project platform-mp: Failed to deploy artifacts: Coul
d not find artifact com.platform:platform-mp:jar:1.0.0 in releases (http:
//nkf:8081/repository/xiaowang-host/) -> [Help 1]
搭建私服
D:\public\mvn\apache-maven-3.2.2\conf\settings.xml
<mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus aliyun</name>
        <url>//maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
阿里仓库改为中央仓库

N:\JetBrains\platform\pom.xml

解决上传第二方jar文件和下载第二方jar文件问题:

<distributionManagement>
      <repository>
        <id>releases.xiaowang</id>
        <name>Releases</name>
        <url>//server2:8081/repository/xiaowang-host/</url>
      </repository>
      <snapshotRepository>
        <id>snapshots.xiaowang</id>
        <name>Snapshot</name>
        <url>//server2:8081/repository/xiaowang-host/</url>
      </snapshotRepository>
    </distributionManagement>
    <repositories>
        <repository>
          <id>releases.xiaowang</id>
          <url>//server2:8081/repository/xiaowang-host/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </repository>
    </repositories>


其它pom.xml文件无需做改?就可以使用mvn deploy 上传和下载第二方jar文件
然后使用mvn package 就没有问题了?/div>

单飞 2019-04-04 09:36 发表评论
]]>springboot+mybatis整合之坑 - 快乐十分精确公式//www.giqrs.com/willpower88/archive/2019/04/03/433703.html一?/dc:creator>一?/author>Wed, 03 Apr 2019 13:41:00 GMT//www.giqrs.com/willpower88/archive/2019/04/03/433703.html//www.giqrs.com/willpower88/comments/433703.html//www.giqrs.com/willpower88/archive/2019/04/03/433703.html#Feedback0//www.giqrs.com/willpower88/comments/commentRss/433703.html//www.giqrs.com/willpower88/services/trackbacks/433703.html
  •  Invalid bound statement (not found)
    在接口名称及方法名称对应OK的情况下,在application.properties中添加:
  • mybatis.mapperLocations=classpath:mapper/*Mapper.xml   
    mybatis.typeAliasesPackage=com.willpower.entity


    ]]>
    Ubuntu16.04配置Android编译环境 - 快乐十分精确公式//www.giqrs.com/liuyanbo/archive/2019/04/03/433702.html天宇恒星天宇恒星Wed, 03 Apr 2019 03:29:00 GMT//www.giqrs.com/liuyanbo/archive/2019/04/03/433702.html//www.giqrs.com/liuyanbo/comments/433702.html//www.giqrs.com/liuyanbo/archive/2019/04/03/433702.html#Feedback0//www.giqrs.com/liuyanbo/comments/commentRss/433702.html//www.giqrs.com/liuyanbo/services/trackbacks/433702.html
    sudo apt-get install -y  openjdk-8-jdk openjdk-8-jre git  build-essential libncurses5-dev:i386  libx11-dev:i386  libreadline6-dev:i386 g++-multilib  tofrodos python-markdown libxml2-utils xsltproc   dpkg-dev  libesd0-dev  git-core gnupg flex bison gperf build-essential  zip curl  gcc-multilib g++-multilib  libc6-dev-i386  lib32ncurses5-dev x11proto-core-dev libx11-dev   ccache   libxml2-utils xsltproc unzip m4 python-pip smbclient libgl1-mesa-dev libsdl1.2-dev zlib1g-dev:i386  lib32z-dev zlib1g-dev lib32z1 lib32ncurses5 lib32stdc++6 libbz2-1.0:i386


    天宇恒星 2019-04-03 11:29 发表评论
    ]]>
    解压System.img的方?/title><link>//www.giqrs.com/liuyanbo/archive/2019/04/03/433701.html</link><dc:creator>天宇恒星</dc:creator><author>天宇恒星</author><pubDate>Wed, 03 Apr 2019 03:27:00 GMT</pubDate><guid>//www.giqrs.com/liuyanbo/archive/2019/04/03/433701.html</guid><wfw:comment>//www.giqrs.com/liuyanbo/comments/433701.html</wfw:comment><comments>//www.giqrs.com/liuyanbo/archive/2019/04/03/433701.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/liuyanbo/comments/commentRss/433701.html</wfw:commentRss><trackback:ping>//www.giqrs.com/liuyanbo/services/trackbacks/433701.html</trackback:ping><description><![CDATA[<br /><pre bash"="" style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; padding: 15px; margin-top: 0px; margin-bottom: 20px; line-height: 1.42857; overflow-wrap: normal; color: #abb2bf; background: #282c34; border: 1px solid #cccccc; border-radius: 4px; word-break: break-word !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; color: inherit; background-color: transparent; border-radius: 0px; padding: 0px; border: none; vertical-align: middle;">$ simg2img system.img system.ext4.img<br /><div class="zxao">$ mkdir system <br />$ sudo mount -t ext4 system.ext4.img system</div></code></pre><img src ="//www.giqrs.com/liuyanbo/aggbug/433701.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/liuyanbo/" target="_blank">天宇恒星</a> 2019-04-03 11:27 <a href="//www.giqrs.com/liuyanbo/archive/2019/04/03/433701.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> 后续内容请移步公众号?8岁fantasy? - 快乐十分精确公式//www.giqrs.com/freeman1984/archive/2019/04/03/433700.html疯狂疯狂Wed, 03 Apr 2019 01:55:00 GMT//www.giqrs.com/freeman1984/archive/2019/04/03/433700.html
    https://www.jianshu.com/u/236331ad452f

    定期发布一些技术和产品内容,欢迎一起交流?img src ="//www.giqrs.com/freeman1984/aggbug/433700.html" width = "1" height = "1" />

    疯狂 2019-04-03 09:55 发表评论
    ]]>
    IM开发者的零基础通信技术入??:通信交换技术的百年发展?? - 快乐十分精确公式//www.giqrs.com/jb2011/archive/2019/04/02/433699.htmlJack JiangJack JiangTue, 02 Apr 2019 05:06:00 GMT//www.giqrs.com/jb2011/archive/2019/04/02/433699.html//www.giqrs.com/jb2011/comments/433699.html//www.giqrs.com/jb2011/archive/2019/04/02/433699.html#Feedback0//www.giqrs.com/jb2011/comments/commentRss/433699.html//www.giqrs.com/jb2011/services/trackbacks/433699.html阅读全文

    Jack Jiang 2019-04-02 13:06 发表评论
    ]]>
    知识科普:IM聊天应用是如何将消息发送给对方的?(非技术篇?/title><link>//www.giqrs.com/jb2011/archive/2019/04/01/433698.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Mon, 01 Apr 2019 10:22:00 GMT</pubDate><guid>//www.giqrs.com/jb2011/archive/2019/04/01/433698.html</guid><wfw:comment>//www.giqrs.com/jb2011/comments/433698.html</wfw:comment><comments>//www.giqrs.com/jb2011/archive/2019/04/01/433698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/jb2011/comments/commentRss/433698.html</wfw:commentRss><trackback:ping>//www.giqrs.com/jb2011/services/trackbacks/433698.html</trackback:ping><description><![CDATA[<h1>快乐双彩交流群:1、引言<br style="box-sizing: border-box;" /></h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">沟通是人类的最基本需求,复杂多变的沟通内容、沟通方式,正是人类文明之所以如此璀璨的关键所在?/p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 623px; max-height: 244px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 244.016px;"></div><div data-width="623" data-height="244" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 623px; height: 244px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-1457124b72dfac3d.jpg" src="//upload-images.jianshu.io/upload_images/1500839-1457124b72dfac3d.jpg" data-original-width="623" data-original-height="244" data-original-format="image/jpeg" data-original-filesize="24861" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">在自然界中,要完成一件事情的沟通,我们可以直接通过声音传递给对方,这是再平常不过的事了(?#8220;?#8221;就能解决)?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">随着计算机的普及,互联网改变了我们的生活,甚至改变了我们的沟通方式。现在,“有什么事微信或QQ上找?#8221;已经是很多的人口头禅了?/p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 500px; max-height: 237px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 237px;"></div><div data-width="500" data-height="237" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 500px; height: 237px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-a7bd38651e2a645a.jpeg" src="//upload-images.jianshu.io/upload_images/1500839-a7bd38651e2a645a.jpeg" data-original-width="500" data-original-height="237" data-original-format="image/jpeg" data-original-filesize="11011" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">那么,作为不懂技术的普通人,有没有想过,你每次使用QQ或微这种IM聊天应用时,你所发送的消息,是如何被计算机送达给对方的?(这显然不可能?#8220;?#8221;解决 ^_^?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">本文将从非技术人员的视角,为你讲解一下IM聊天应用中的聊天消息是怎么发送的?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">学习交流?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">- 即时通讯/推送技术开发交?群:<a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">101279154</a>[推荐]</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">- 移动端IM开发入门文章:?a target="_blank" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">新手入门一篇就够:从零开发移动端IM</a>?/p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">(本文同步发布于?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">//www.52im.net/thread-2433-1-1.html</a>?/p><h1 class="zxao">2、关于作?/h1><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 200px; max-height: 165px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 165px;"></div><div data-width="200" data-height="165" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 200px; height: 165px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-11062a6646887d5d.jpg" src="//upload-images.jianshu.io/upload_images/1500839-11062a6646887d5d.jpg" data-original-width="200" data-original-height="165" data-original-format="image/jpeg" data-original-filesize="14128" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">巩鹏军:</span>专注移动开发十多年,热爱即时通讯技术。个人微信公众号?#8220;巩鹏?#8221;?/p><h1 class="zxao">3、阅读对?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">本文适合非技术背景的读者阅读,如您喜欢本文,则下列文章您也可能喜欢?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">技术往事:微信估值已?千亿,雷军曾有机会收编张小龙及其Foxmail</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">QQ和微信凶猛成长的背后:腾讯网络基础架构的这些年</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">闲话即时通讯:腾讯的成长史本质就是一部QQ成长?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">腾讯开发微信花了多少钱?技术难度真这么大?难在哪?</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">技术往事:史上最全QQ图标变迁过程,追寻IM巨人的演进历?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">开发往事:深度讲述2010?015,微信一路风雨的背后</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">开发往事:记录微信3.0版背后的故事(距微信1.0发布9个月时)</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">微信七年回顾:历经多少质疑和差评,才配拥有今天的强大</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">前创始团队成员分享:盘点微信的前世今?#8212;—微信成功的必然和偶然</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">QQ的成功,远没有你想象的那么顺利和轻松</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">[技术脑洞] 如果?4亿中国人拉到一个微信群里技术上能实现吗?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">QQ和微信止步不前,意味着即时通讯社交应用创业的第2春已来?</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">那些年微信开发过的鸡肋功能,及其带给我们的思?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">为什么说即时通讯社交APP创业就是一个坑?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">即时通讯创业必读:解密微信的产品定位、创新思维、设计法则等</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">老罗最新发布了“子弹短信”这款IM,主打熟人社交能否对标微信?</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">盘点和反思在微信的阴影下艰难求生的移动端IM应用</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">QQ现状深度剖析:你还认为QQ已经被微信打败了吗?</a></p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">那些年微信开发过的鸡肋功能,及其带给我们的思?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">渐行渐远的人人网:十年亲历者的互联网社交产品复盘和反?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">中国互联网社交二十年:全民见证的互联网创业演?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">IM热门功能讨论:为什么微信里没有消息“已读”功能?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">读懂微信:从1.0?.0版本,一个主流IM社交工具的进化史</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">王欣回应微信封禁,解释为何取?#8220;马桶MT”</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">同为IM社交产品中的王者,QQ与微信到底有什么区?/a>?/p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">还原真实的腾讯:从最不被看好,到即时通讯巨头的草根创业史</a>?/p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">如果您是专业技术人员,则跟本文相关的专业技术知识等,可以以下文章中找到?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">从客户端的角度来谈谈移动端IM的消息可靠性和送达机制</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">移动端IM中大规模群消息的推送如何保证效率、实时性?</a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">IM消息送达保证机制实现(一):保证在线实时消息的可靠投?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">IM消息送达保证机制实现(?:保证离线消息的可靠投?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">如何保证IM实时消息?#8220;时序?#8221;?#8220;一致?#8221;?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">IM单聊和群聊中的在线状态同步应该用“?#8221;还是“?#8221;?/a>?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">IM群聊消息如此复杂,如何保证不丢不重?</a>?/p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">完全自已开发的IM该如何设?#8220;失败重试”机制?/a>?/p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">好了,费话不多说,我们开始正文部分。。?/p><h1 class="zxao">4、在微信里,我们发送一条聊天消息是如此简?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">李雷在手机上打开微信(IM客户端),在聊天输框中输?#8220;Hello!”,点击发送。几乎是瞬间,韩梅梅手机上的微信(IM客户端)就会显示李雷的头像后面跟着“Hello!”?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">整个过程如下图所示:</span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 700px; max-height: 544px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 397.875px;"></div><div data-width="957" data-height="544" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 700px; height: 397.875px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-239ec62f72adb426.jpg" src="//upload-images.jianshu.io/upload_images/1500839-239ec62f72adb426.jpg" data-original-width="957" data-original-height="544" data-original-format="image/jpeg" data-original-filesize="59570" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div><div style="box-sizing: border-box; min-width: 20%; max-width: 80%; min-height: 22px; display: inline-block; padding: 10px; margin: 0px auto; border-bottom: 1px solid #d9d9d9; font-size: 14px; color: #969696; line-height: 1.7;">▲ 一条聊天消息发送的全过?/div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">从上面的图示可以看到,整个过程涉及三大部分:</span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">1)李雷手机上的IM客户端(微信);</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">2)IM服务端;</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">3)韩梅梅手机上的IM客户端(微信)?/p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">下面,我们逐一介绍每个部分的具体工作原理?/p><h1 class="zxao">5、消息发送者:发送端是怎么工作的?</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">先看看发送端,李雷手机上的IM客户端中发生了什么?</p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 457px; max-height: 1437px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 937.984px;"></div><div data-width="457" data-height="938" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 457px; height: 937.984px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-f7388b372b512fa8.jpg" src="//upload-images.jianshu.io/upload_images/1500839-f7388b372b512fa8.jpg" data-original-width="457" data-original-height="938" data-original-format="image/jpeg" data-original-filesize="47880" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">从上图可以看出,发送一条信息经过三个步骤:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">1)消息编辑:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">李雷操作键盘输入要发送的文字,点?#8220;发?#8221;按钮。这一切都发生在IM客户端的界面模块中。类似用笔在信纸上写信,键盘就是笔,聊天框就是信纸;</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">2)消息入库:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">IM客户端中的数据模块会先将聊天内容“Hello!”加上谁发给谁等信息,按标准格式打包为一条IM消息,并存入本地数据库。这类似信纸装入信封,填写地址,投入邮箱的过程。一条IM消息就是一封信,本地数据库就是李雷家的邮箱?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">3)消息发送:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">IM客户端中的网络模块通过长连接将IM消息发给IM服务端。这类似邮递员将信件汇总发往邮政局。网络模块就是邮递员,IM服务端就是邮政局。(长连接是IM客户端跟IM服务端一直保持的网络链路)?/p><h1 class="zxao">6、消?#8220;中转?#8221;:IM服务端是怎么工作的?</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">担负“邮政局”职责的IM服务端是IM世界中全知全能的神,它认识所有人,经手所有消息,跟每个人都一直保持联系(长连接)?/p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 356px; max-height: 1835px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 933px;"></div><div data-width="356" data-height="933" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 356px; height: 933px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-871c1ea17c1e0651.jpg" src="//upload-images.jianshu.io/upload_images/1500839-871c1ea17c1e0651.jpg" data-original-width="356" data-original-height="933" data-original-format="image/jpeg" data-original-filesize="38807" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">每条消息在IM服务端中都要至少经过以下处理?/span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">1)消息接收:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">长连接服务从和李雷的长连接接收到“Hello!”的IM消息。IM服务端跟所有登录的IM客户端保持长连接(一条一直活跃的网络链路,每个客户端一条),长连接上定时会有心跳消息来监测客户端的在线离线状态,心跳消息就像邮递员每天都会在邮政局和邮箱之间巡回一样;</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">2)消息验证:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">用户服务查询IM消息的目标人韩梅梅,以及发送人李雷和目标人韩梅梅是否好友关系,确保韩梅梅是真实存在而非虚构的,并且韩梅梅愿意接收李雷的消息,否则会给李雷退信。(一般IM服务端会将IM消息的副本存入数据库中备份)?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">3)消息转发:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">在长连接服务中找到跟韩梅梅手机上IM客户端保持的长连接,并将消息发送给韩梅梅?/p><h1 class="zxao">7、消息接收者:接收端又是怎么工作的呢?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">下面看看韩梅梅手机上发生了什么?</p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 485px; max-height: 1191px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 824.984px;"></div><div data-width="485" data-height="825" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 485px; height: 824.984px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-94f93d05d655e052.jpg" src="//upload-images.jianshu.io/upload_images/1500839-94f93d05d655e052.jpg" data-original-width="485" data-original-height="825" data-original-format="image/jpeg" data-original-filesize="44831" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">韩梅梅手机上的IM客户端和李雷(发送者)的是一样的,但处理步骤是不同的?/span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">1)消息接收:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">网络模块通过跟IM服务端保持的长连接接收IM消息?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">2)消息入库:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">网络模块会将IM消息存入本地数据库,即信件投入了韩梅梅家的邮箱。网络模块就是邮递员,本地数据库就是韩梅梅家的邮箱;</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">3)消息展示:</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">界面模块获取发送人头像,和消息内容一起显示在聊天界面上?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">经过上述过程,韩梅梅在自己手机上就看到了李雷发过来的“Hello!”,因为李雷和韩梅梅都是一直和服务器保持长连接,所以上述过程是瞬间完成的,李雷和韩梅梅感觉就像面对面聊天一样方便。这也是Instant Messaging名字的来历?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">(本文同步发布于?a target="_blank" rel="nofollow" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">//www.52im.net/thread-2433-1-1.html</a>?/p><img src ="//www.giqrs.com/jb2011/aggbug/433698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.giqrs.com/jb2011/" target="_blank">Jack Jiang</a> 2019-04-01 18:22 <a href="//www.giqrs.com/jb2011/archive/2019/04/01/433698.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Elasticsearch fails access to external network on openstack instance - 快乐十分精确公式//www.giqrs.com/Bryan/archive/2019/04/01/433697.htmlLife is no respector of any genius.Life is no respector of any genius.Mon, 01 Apr 2019 01:12:00 GMT//www.giqrs.com/Bryan/archive/2019/04/01/433697.html//www.giqrs.com/Bryan/comments/433697.html//www.giqrs.com/Bryan/archive/2019/04/01/433697.html#Feedback0//www.giqrs.com/Bryan/comments/commentRss/433697.html//www.giqrs.com/Bryan/services/trackbacks/433697.html阅读全文

    ]]>
    Java堆外内存排查小结【转?/title><link>//www.giqrs.com/xiaomage234/archive/2019/03/30/433695.html</link><dc:creator>小马?/dc:creator><author>小马?/author><pubDate>Sat, 30 Mar 2019 03:44:00 GMT</pubDate><guid>//www.giqrs.com/xiaomage234/archive/2019/03/30/433695.html</guid><wfw:comment>//www.giqrs.com/xiaomage234/comments/433695.html</wfw:comment><comments>//www.giqrs.com/xiaomage234/archive/2019/03/30/433695.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.giqrs.com/xiaomage234/comments/commentRss/433695.html</wfw:commentRss><trackback:ping>//www.giqrs.com/xiaomage234/services/trackbacks/433695.html</trackback:ping><description><![CDATA[from:<a >https://blog.csdn.net/lycyingO/article/details/80854669<br /><br /><br /><div class="zxao"> 版权声明:微信公众号《小姐姐味道》,转载注明出处<span style="white-space:pre"> </span>https://blog.csdn.net/lycyingO/article/details/80854669</div><div class="zxao"></div><div class="zxao"></div><div class="zxao">简?/div><div class="zxao">JVM堆外内存难排查但经常会出现问题,这可能是目前最全的JVM堆外内存排查思路?/div><div class="zxao"></div><div class="zxao">通过本文,你应该了解?/div><div class="zxao"></div><div class="zxao">pmap 命令</div><div class="zxao">gdb 命令</div><div class="zxao">perf 命令</div><div class="zxao">内存 RSS、VSZ的区?/div><div class="zxao">java NMT</div><div class="zxao">起因</div><div class="zxao">这几天遇到一个比较奇怪的问题,觉得有必要和大家分享一下。我们的一个服务,运行在docker上,在某个版本之后,占用的内存开始增长,直到docker分配的内存上限,但是并不会OOM。版本的更改如下?/div><div class="zxao"></div><div class="zxao">升级了基础软件的版?/div><div class="zxao">将docker的内存上限由4GB扩展?GB</div><div class="zxao">上上个版本的一项变动是使用了EhCache的Heap缓存</div><div class="zxao">没有读文件,也没有mmap操作</div><div class="zxao">使用jps 查看启动参数,发现分配了大约3GB的堆内存</div><div class="zxao"></div><div class="zxao">[root]$ jps -v</div><div class="zxao">75 Bootstrap -Xmx3000m -Xms3000m  -verbose:gc -Xloggc:/home/logs/gc.log -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSCompactAtFullCollection -XX:MaxTenuringThreshold=10 -XX:MaxPermSize=128M -XX:SurvivorRatio=3 -XX:NewRatio=2 -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+UseParNewGC -XX:+UseConcMarkSweepGC</div><div class="zxao">使用ps查看进程使用的内存和虚拟内存 ( Linux内存管理 )。除了虚拟内存比较高达到17GB以外,实际使用的内存RSS也夸张的达到?GB,远远超过了-Xmx的设定?/div><div class="zxao"></div><div class="zxao">[root]$ ps -p 75 -o rss,vsz  </div><div class="zxao"> </div><div class="zxao">RSS    VSZ 7152568 17485844</div><div class="zxao">原创文章,转载注明出?(//sayhiai.com)</div><div class="zxao">排查过程</div><div class="zxao">明显的,是有堆外内存的使用,不太可能是由于EhCache引起的(因为我们使用了heap方式)。了解到基础软件的升级涉及到netty版本升级,netty会用到一些DirectByteBuffer,第一轮排查我们采用如下方式:</div><div class="zxao"></div><div class="zxao">jmap -dump:format=b,file=75.dump 75 通过分析堆内存找到DirectByteBuffer的引用和大小</div><div class="zxao">部署一个升级基础软件之前的版本,持续观察</div><div class="zxao">部署另一个版本,更改EhCache限制其大小到1024M</div><div class="zxao">考虑到可能由Docker的内存分配机制引起,部署一实例到实体机</div><div class="zxao">结果4个环境中的服务,无一例外的都出现了内存超用的问题。问题很奇怪,宝宝睡不着觉?/div><div class="zxao"></div><div class="zxao">pmap</div><div class="zxao">为了进一步分析问题,我们使用pmap查看进程的内存分配,通过RSS升序序排列。结果发现除了地址000000073c800000上分配的3GB堆以外,还有数量非常多的64M一块的内存段,还有巨量小的物理内存块映射到不同的虚拟内存段上。但到现在为止,我们不知道里面的内容是什么,是通过什么产生的?/div><div class="zxao"></div><div class="zxao">[root]$ pmap -x 75  | sort -n -k3</div><div class="zxao"> </div><div class="zxao">.....省略N?/div><div class="zxao"> </div><div class="zxao">0000000040626000   55488   55484   55484 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa07c000000   65536   55820   55820 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa044000000   65536   55896   55896 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa0c0000000   65536   56304   56304 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9db8000000   65536   56360   56360 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa0b8000000   65536   56836   56836 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa084000000   65536   57916   57916 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9ec4000000   65532   59752   59752 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa008000000   65536   60012   60012 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9e58000000   65536   61608   61608 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9f18000000   65532   61732   61732 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa018000000   65532   61928   61928 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa088000000   65536   62336   62336 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa020000000   65536   62428   62428 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9e44000000   65536   64352   64352 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9ec0000000   65528   64928   64928 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa050000000   65532   65424   65424 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9e08000000   65512   65472   65472 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9de0000000   65524   65512   65512 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9dec000000   65532   65532   65532 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9dac000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9dc8000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9e30000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007f9eb4000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa030000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">00007fa0b0000000   65536   65536   65536 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">000000073c800000 3119140 2488596 2487228 rwx--    [ anon ]</div><div class="zxao"> </div><div class="zxao">total kB        17629516 7384476 7377520</div><div class="zxao">通过google,找到以下资?Linux glibc >= 2.10 (RHEL 6) malloc may show excessive virtual memory usage)</div><div class="zxao"></div><div class="zxao">文章指出造成应用程序大量申请64M大内存块的原因是由Glibc的一个版本升级引起的,通过export MALLOC_ARENA_MAX=4可以解决VSZ占用过高的问题。虽然这也是一个问题,但却不是我们想要的,因为我们增长的是物理内存,而不是虚拟内存?/div><div class="zxao"></div><div class="zxao">NMT</div><div class="zxao">幸运的是 JDK1.8有Native Memory Tracker可以帮助定位。通过在启动参数上加入-XX:NativeMemoryTracking=detail就可以启用。在命令行执行jcmd可查看内存分配?/div><div class="zxao"></div><div class="zxao">#jcmd 75 VM.native_memory summary</div><div class="zxao"> </div><div class="zxao">Native Memory Tracking: Total: reserved=5074027KB, committed=3798707KB -                 Java Heap (reserved=3072000KB, committed=3072000KB)                            (mmap: reserved=3072000KB, committed=3072000KB) -                     Class (reserved=1075949KB, committed=28973KB)                            (classes #4819)                            (malloc=749KB #13158)                            (mmap: reserved=1075200KB, committed=28224KB) -                    Thread (reserved=484222KB, committed=484222KB)                            (thread #470)                            (stack: reserved=482132KB, committed=482132KB)                            (malloc=1541KB #2371)                            (arena=550KB #938) -                      Code (reserved=253414KB, committed=25070KB)                            (malloc=3814KB #5593)                            (mmap: reserved=249600KB, committed=21256KB) -                        GC (reserved=64102KB, committed=64102KB)                            (malloc=54094KB #255)                            (mmap: reserved=10008KB, committed=10008KB) -                  Compiler (reserved=542KB, committed=542KB)                            (malloc=411KB #543)                            (arena=131KB #3) -                  Internal (reserved=50582KB, committed=50582KB)                            (malloc=50550KB #13713)                            (mmap: reserved=32KB, committed=32KB) -                    Symbol (reserved=6384KB, committed=6384KB)                            (malloc=4266KB #31727)                            (arena=2118KB #1) -    Native Memory Tracking (reserved=1325KB, committed=1325KB)                            (malloc=208KB #3083)                            (tracking overhead=1117KB) -               Arena Chunk (reserved=231KB, committed=231KB)                            (malloc=231KB) -                   Unknown (reserved=65276KB, committed=65276KB)                            (mmap: reserved=65276KB, committed=65276KB)</div><div class="zxao">虽然pmap得到的内存地址和NMT大体能对的上,但仍然有不少内存去向成谜。虽然是个好工具但问题并不能解决?/div><div class="zxao"></div><div class="zxao">gdb</div><div class="zxao">非常好奇64M或者其他小内存块中是什么内容,接下来通过gdbdump出来。读?proc目录下的maps文件,能精准的知晓目前进程的内存分布?/div><div class="zxao"></div><div class="zxao">以下脚本通过传入进程id,能够将所关联的内存全部dump到文件中(会影响服务,慎用)?/div><div class="zxao"></div><div class="zxao">grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch --pid $1 -ex "dump memory $1-$start-$stop.dump 0x$start 0x$stop"; done</div><div class="zxao">更多时候,推荐之dump一部分内存?再次提醒操作会影响服务,注意dump的内存块大小,慎??/div><div class="zxao"></div><div class="zxao">gdb --batch --pid 75 -ex "dump memory a.dump 0x7f2bceda1000 0x7f2bcef2b000</div><div class="zxao">[root]$ du -h *</div><div class="zxao">dump 4.0K</div><div class="zxao">55-00600000-00601000.dump 400K</div><div class="zxao">55-00eb7000-00f1b000.dump 0</div><div class="zxao">55-704800000-7c0352000.dump 47M</div><div class="zxao">55-7f2840000000-7f2842eb8000.dump 53M</div><div class="zxao">55-7f2848000000-7f284b467000.dump 64M</div><div class="zxao">55-7f284c000000-7f284fffa000.dump 64M</div><div class="zxao">55-7f2854000000-7f2857fff000.dump 64M</div><div class="zxao">55-7f285c000000-7f2860000000.dump 64M</div><div class="zxao">55-7f2864000000-7f2867ffd000.dump 1016K</div><div class="zxao">55-7f286a024000-7f286a122000.dump 1016K</div><div class="zxao">55-7f286a62a000-7f286a728000.dump 1016K</div><div class="zxao">55-7f286d559000-7f286d657000.dump</div><div class="zxao">是时候查看里面的内容?/div><div class="zxao"></div><div class="zxao">[root]$ view 55-7f284c000000-7f284fffa000.dump</div><div class="zxao">^@^@X+^?^@^@^@^@^@d(^?^@^@^@ ÿ^C^@^@^@^@^@ ÿ^C^@^@^@^@^@^@^@^@^@^@^@^@±<97>p^C^@^@^@^@ 8^^Z+^?^@^@ ^@^@d(^?^@^@ 8^^Z+^?^@^@ ^@^@d(^?^@^@</div><div class="zxao">achine":524993642,"timeSecond":1460272569,"inc":2145712868,"new":false},"device":{"client":"android","uid":"xxxxx","version":881},"</div><div class="zxao">device_android":{"BootSerialno":"xxxxx","CpuInfo":"0-7","MacInfo":"2c:5b:b8:b0:d5:10","RAMSize":"4027212","SdcardInfo":"xxxx","Serialno":"xxxx",</div><div class="zxao">"android_id":"488aedba19097476","buildnumber":"KTU84P/1416486236","device_ip":"0.0.0.0","mac":"2c:5b:b8:b0:d5:10","market_source":"12","model":"OPPO ...more</div><div class="zxao">纳尼?这些内容不应该在堆里面么?为何还会使用额外的内存进行分配?上面已经排查netty申请directbuffer的原因了,那么还有什么地方在分配堆外内存呢?</div><div class="zxao"></div><div class="zxao">perf</div><div class="zxao">传统工具失灵,快到了黔驴技穷的时候了,是时候祭出神器perf了?/div><div class="zxao"></div><div class="zxao">使用 perf record -g -p 55 开启监控栈函数调用。运行一段时间后Ctrl+C结束,会生成一个文件perf.data?/div><div class="zxao"></div><div class="zxao">执行perf report -i perf.data查看报告?/div><div class="zxao"></div><div class="zxao"></div><div class="zxao">如图,进程大量执行bzip相关函数。搜索zip,结果如下:</div><div class="zxao"></div><div class="zxao"></div><div class="zxao"></div><div class="zxao">-.-!</div><div class="zxao"></div><div class="zxao">进程调用了Java_java_util_zip_Inflater_inflatBytes() 申请了内存,仅有一小部分调用Deflater释放内存。与pmap内存地址相比对,确实是bzip在搞鬼?/div><div class="zxao"></div><div class="zxao">原创文章,转载注明出?(//sayhiai.com)</div><div class="zxao">解决</div><div class="zxao">java项目搜索zip定位到代码,发现确实有相关bzip压缩解压操作,而且GZIPInputStream有个地方没有close?/div><div class="zxao"></div><div class="zxao">GZIPInputStream使用Inflater申请堆外内存,Deflater释放内存,调用close()方法来主动释放。如果忘记关闭,Inflater对象的生命会延续到下一次GC。在此过程中,堆外内存会一直增长?/div><div class="zxao"></div><div class="zxao">原代码:</div><div class="zxao"></div><div class="zxao">public byte[] decompress ( byte[] input) throws IOException {</div><div class="zxao">                ByteArrayOutputStream out = new ByteArrayOutputStream();</div><div class="zxao">                IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(input)), out);</div><div class="zxao">                return out.toByteArray();</div><div class="zxao">            }</div><div class="zxao">修改后:</div><div class="zxao"></div><div class="zxao"> public byte[] decompress(byte[] input) throws IOException {</div><div class="zxao">        ByteArrayOutputStream out = new ByteArrayOutputStream();</div><div class="zxao">        GZIPInputStream gzip = new GZIPInputStream(new ByteArrayInputStream(input));</div><div class="zxao">        IOUtils.copy(gzip, out);</div><div class="zxao">        gzip.close();</div><div class="zxao">        return out.toByteArray();</div><div class="zxao">    }</div><div class="zxao">经观察,问题解决?/div><div class="zxao">--------------------- </div><div class="zxao">作者:lycyingO </div><div class="zxao">来源:CSDN </div><div class="zxao">原文:https://blog.csdn.net/lycyingO/article/details/80854669 </div><div class="zxao">版权声明:本文为博主原创文章,转载请附上博文链接?/div></a><img src ="//www.giqrs.com/xiaomage234/aggbug/433695.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.giqrs.com/" title="快乐十分精确公式">快乐十分精确公式</a></div>]]></description></item></channel></rss><li><a href="//www.giqrs.com/ztr385/80767317.html ">Žίֱٿίί ػĸЩҪ </a> 2019-04-10</li> <li><a href="//www.giqrs.com/f15529/79939516.html ">2018Eָ е </a> 2019-04-07</li> <li><a href="//www.giqrs.com/7v7410/83964215.html ">264·ҷͶһȻʡ </a> 2019-04-07</li> <li><a href="//www.giqrs.com/z55593/65412014.html ">̫ʿѧҵ֤ص糣 </a> 2019-04-06</li> <li><a href="//www.giqrs.com/95j513/73338913.html ">нƻͶ158 ޽Ҹ·չ </a> 2019-04-06</li> <li><a href="//www.giqrs.com/037975/19332412.html ">¸ڱ ޡ塱 ¸ </a> 2019-04-03</li> <li><a href="//www.giqrs.com/kj8366/7527911.html ">ʷ20184ڷ漰Ŀ¼ </a> 2019-04-03</li> <li><a href="//www.giqrs.com/h5653/20325310.html ">ͳƾ֣5·ݾҪָص </a> 2019-03-27</li> <li><a href="//www.giqrs.com/plh188/9645989.html ">Ʒרйҵ </a> 2019-03-27</li> <li><a href="//www.giqrs.com/g2s592/8815448.html ">ϰƽͬϺ֯Ա쵼˹߲ͬ </a> 2019-03-27</li> <li><a href="//www.giqrs.com/1h9468/2016897.html "≯쵼йɫʵ </a> 2019-03-20</li> <li><a href="//www.giqrs.com/uj92/991406.html ">ϰƽһǻԻʷ ƽǿҵ </a> 2019-03-20</li> <li><a href="//www.giqrs.com/5nx883/1277175.html "> ǰСϰƽɽطü </a> 2019-03-19</li> <li><a href="//www.giqrs.com/90u269/1795244.html ">ȫ湩Ӧ׼ </a> 2019-03-19</li> <li><a href="//www.giqrs.com/0ci524/4803233.html ">˼άһᰲ˴2ǰ </a> 2019-03-16</li> <script>(function(){ var src = (document.location.protocol == "") ? "//js.passport.qihucdn.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743":"https://jspassport.ssl.qhimg.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>