<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[编程的本质是数学问题]]></title><description><![CDATA[学源码是最快的学习方法]]></description><link>https://blog.csdn.net/unix21</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; unix21]]></copyright><item><title><![CDATA[Java字节码研究]]></title><link>https://blog.csdn.net/unix21/article/details/88196253</link><guid>https://blog.csdn.net/unix21/article/details/88196253</guid><author>unix21</author><pubDate>Tue, 05 Mar 2019 18:49:39 +0800</pubDate><description><![CDATA[本文在本人2个博客https://blog.csdn.net/21aspnet和https://blog.csdn.net/unix21unix21同步发布

1.String和常连池

先上代码：


public class TestApp {

    public static void main(String[] args) {
        
        String s1 = ...]]></description><category></category></item><item><title><![CDATA[Java字节码instrument研究]]></title><link>https://blog.csdn.net/unix21/article/details/81908817</link><guid>https://blog.csdn.net/unix21/article/details/81908817</guid><author>unix21</author><pubDate>Tue, 21 Aug 2018 15:54:36 +0800</pubDate><description><![CDATA[MyAgent项目


&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocatio...]]></description><category></category></item><item><title><![CDATA[JVM虚拟机参数配置官方文档]]></title><link>https://blog.csdn.net/unix21/article/details/79849485</link><guid>https://blog.csdn.net/unix21/article/details/79849485</guid><author>unix21</author><pubDate>Sun, 08 Apr 2018 11:23:51 +0800</pubDate><description><![CDATA[JDK8 https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.htmlJDK7 https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html官方博客 https://blogs.oracle.com/poonam/==============...]]></description><category></category></item><item><title><![CDATA[Linux kernel futex.c的bug导致JVM不可用]]></title><link>https://blog.csdn.net/unix21/article/details/79847857</link><guid>https://blog.csdn.net/unix21/article/details/79847857</guid><author>unix21</author><pubDate>Sun, 08 Apr 2018 09:54:01 +0800</pubDate><description><![CDATA[JVM死锁导致线程不可用，然后会瞬间起N个线程，当然也是不可用的，因为需要的对象死锁，然后耗尽文件句柄导致外部TCP无法建议拒绝服务，jstack之后就会恢复。解决办法：替换中间件类库 ，比如httpclient的。原因大致是：某个switch分支缺少memory barrier的正确处理，导致外部应用如JVM的lock被错误锁住；一般jstack连后就恢复。https://github.com/...]]></description><category></category></item><item><title><![CDATA[Java堆外内存泄露分析]]></title><link>https://blog.csdn.net/unix21/article/details/79161250</link><guid>https://blog.csdn.net/unix21/article/details/79161250</guid><author>unix21</author><pubDate>Thu, 25 Jan 2018 14:18:29 +0800</pubDate><description><![CDATA[查看堆内存占用正常，jvm垃圾回收也没有异常。而top出来显示java占用内存是几个G，那么可能想到了是堆外内存泄漏。
需要安装google-perftools工具进行分析

1.先安装g++
不然编译会报错：g++: command not found
# yum -y install gcc gcc-c++
----
2.安装libunwind
不建议版本>0.99据说有问题，]]></description><category></category></item><item><title><![CDATA[线上java问题排查]]></title><link>https://blog.csdn.net/unix21/article/details/79093784</link><guid>https://blog.csdn.net/unix21/article/details/79093784</guid><author>unix21</author><pubDate>Thu, 18 Jan 2018 11:24:38 +0800</pubDate><description><![CDATA[0.jps
这个输出java进程pid
#jps


查看java的线程
#top -Hp 25448


如图25757这个线程比较耗时，看看他在做什么


注意需要折算出线程pid的16进制值，然后jstack。
可以打印更多信息
#jstack pid | grep -A 20 649d



参考：JVM调优之jstack找出最耗cpu的线程并定位代码]]></description><category></category></item><item><title><![CDATA[用“逐步排除”的方法定位Java服务线上“系统性”故障]]></title><link>https://blog.csdn.net/unix21/article/details/78980660</link><guid>https://blog.csdn.net/unix21/article/details/78980660</guid><author>unix21</author><pubDate>Fri, 05 Jan 2018 14:12:34 +0800</pubDate><description><![CDATA[说明：原文地址已经不可访问，其他地方有转载，不过很多丢失图片，所以，找到一处有图的重新配好图。



用“逐步排除”的方法定位Java服务线上“系统性”故障

Posted on 2014/08/25

李斯宁（高级测试开发工程师）

一、摘要
由于硬件问题、系统资源紧缺或者程序本身的BUG，Java服务在线上不可避免地会出现一些“系统性”故障，比如：服务性能明显下降、部分（]]></description><category></category></item><item><title><![CDATA[Java常用命令及Java Dump]]></title><link>https://blog.csdn.net/unix21/article/details/78852731</link><guid>https://blog.csdn.net/unix21/article/details/78852731</guid><author>unix21</author><pubDate>Wed, 20 Dec 2017 14:19:59 +0800</pubDate><description><![CDATA[线程Dump,包含所有线程的运行状态。纯文本格式。
堆Dump,包含线程Dump,幵包含所有堆对象的状态。二进制格式。

Java Dump方法
1.使用Java虚拟机制作Dump
指示虚拟机在发生内存不足错误时,自动生成堆Dump
-XX:+HeapDumpOnOutOfMemoryError


2.使用图形化工具制作Dump
使用JDK(1.6)自带的工具:Java Vi]]></description><category></category></item><item><title><![CDATA[Java的SPI机制]]></title><link>https://blog.csdn.net/unix21/article/details/66976570</link><guid>https://blog.csdn.net/unix21/article/details/66976570</guid><author>unix21</author><pubDate>Mon, 27 Mar 2017 20:45:34 +0800</pubDate><description><![CDATA[Dubbo等框架使用到必须掌握。
package org.hadoop.java;

public interface IService {
    public String sayHello();      
    public String getScheme();
}
package org.hadoop.java;

public class HDFSService impleme]]></description><category></category></item><item><title><![CDATA[匿名内部类和传接口]]></title><link>https://blog.csdn.net/unix21/article/details/66974168</link><guid>https://blog.csdn.net/unix21/article/details/66974168</guid><author>unix21</author><pubDate>Mon, 27 Mar 2017 17:45:40 +0800</pubDate><description><![CDATA[匿名内部类也就是没有名字的内部类
正因为没有名字，所以匿名内部类只能使用一次，它通常用来简化代码编写
但使用匿名内部类还有个前提条件：必须继承一个父类或实现一个接口
参考：http://www.cnblogs.com/nerxious/archive/2013/01/25/2876489.html


public interface MyInterface {

    public]]></description><category></category></item><item><title><![CDATA[编程经验]]></title><link>https://blog.csdn.net/unix21/article/details/54890894</link><guid>https://blog.csdn.net/unix21/article/details/54890894</guid><author>unix21</author><pubDate>Mon, 06 Feb 2017 11:06:45 +0800</pubDate><description><![CDATA[1.变量下面多处使用
那么不应该直接在第一处修改 需要另一个变量或者开一个函数


String TypeCode = (String) md.get("TypeCode");
                if (!StaticUtil.XXXs.contains(TypeCode+"_")) {
                    continue;
              ]]></description><category></category></item><item><title><![CDATA[SpringBoot使用笔记]]></title><link>https://blog.csdn.net/unix21/article/details/53966184</link><guid>https://blog.csdn.net/unix21/article/details/53966184</guid><author>unix21</author><pubDate>Sun, 01 Jan 2017 14:20:15 +0800</pubDate><description><![CDATA[其实也是参考官方的：http://spring.io/guides/gs/rest-service/


SpringBoot并不神秘，其最大的好处是可以帮你省略引用一堆jar包，需要神秘jar它自动帮你引用，集成tomcat，集成配置等待好处太多，总之就是更方便开发而已。
还是自己体验下比较好。


1.建立java应用程序
起一个Maven的java应用程序，注意不要再起Web]]></description><category></category></item><item><title><![CDATA[Tomcat定时任务]]></title><link>https://blog.csdn.net/unix21/article/details/53669208</link><guid>https://blog.csdn.net/unix21/article/details/53669208</guid><author>unix21</author><pubDate>Thu, 15 Dec 2016 13:13:18 +0800</pubDate><description><![CDATA[原文:
The   load-on-startup   element   indicates   that   this   servlet   should   be   loaded   (instantiated   and   have   its   init()   called)   on   the   startup   of   the   web   applicatio]]></description><category></category></item><item><title><![CDATA[String和常量池]]></title><link>https://blog.csdn.net/unix21/article/details/53433648</link><guid>https://blog.csdn.net/unix21/article/details/53433648</guid><author>unix21</author><pubDate>Fri, 02 Dec 2016 13:15:17 +0800</pubDate><description><![CDATA[String s1 = "abc";// 放在常量池中
        String s2 = "abc";// 从常量池中查找
        String s3 = new String("abc");//new放在堆中
        String s4 = new String("abc");
        String s5 = s1.intern();
        String]]></description><category></category></item><item><title><![CDATA[JVM内存溢出的几种情形]]></title><link>https://blog.csdn.net/unix21/article/details/53432707</link><guid>https://blog.csdn.net/unix21/article/details/53432707</guid><author>unix21</author><pubDate>Fri, 02 Dec 2016 11:09:22 +0800</pubDate><description><![CDATA[java虚拟机规范定义了两种异常与栈空间有关：StackOverflowError和OutOfMemoryError
线程计算过程中 栈深度>最大可用栈深度 抛出StackOverflowError
如果栈可以动态扩展，如果扩展过程中没有足够内存空间支持会抛出OutOfMemoryError
-Xss设置栈大小，栈大小决定了函数调用的可达深度



public class Test]]></description><category></category></item><item><title><![CDATA[MySQL常用性能分析方法-profile，explain，索引]]></title><link>https://blog.csdn.net/unix21/article/details/52933420</link><guid>https://blog.csdn.net/unix21/article/details/52933420</guid><author>unix21</author><pubDate>Wed, 26 Oct 2016 13:49:46 +0800</pubDate><description><![CDATA[1.查版本号
无论做什么都要确认版本号，不同的版本号下会有各种差异。
>Select  version();





2.执行状态分析
显示哪些线程正在运行

>show processlist;


下面是完整的信息]]></description><category></category></item><item><title><![CDATA[事务隔离机制原理分析以及是否可以防止订单超卖]]></title><link>https://blog.csdn.net/unix21/article/details/52852342</link><guid>https://blog.csdn.net/unix21/article/details/52852342</guid><author>unix21</author><pubDate>Tue, 18 Oct 2016 20:35:04 +0800</pubDate><description><![CDATA[事务的隔离机制是指：
Read Uncommitted（读取未提交内容）
Read Committed（读取提交内容）
Repeatable Read（可重读）
Serializable（可串行化）
具体的解释最经典的MySQL书《高性能MySQL(第3版)》以及有了就不在其他地方再引用了：


隔离机制的比较




其实也有人喜欢用锁来控制并发，书中还提到了“隐式”和]]></description><category></category></item><item><title><![CDATA[Spring源码分析【8】-分布式环境SpringSecurity保持用户会话]]></title><link>https://blog.csdn.net/unix21/article/details/52817809</link><guid>https://blog.csdn.net/unix21/article/details/52817809</guid><author>unix21</author><pubDate>Fri, 14 Oct 2016 17:49:19 +0800</pubDate><description><![CDATA[1.SpringSecurity的权限控制流程是这样的：
用户登录，基础信息UserInfo存在SpringSecurity的ThreadLocal里。




下面是contextHolder对象：
final class ThreadLocalSecurityContextHolderStrategy implements
		SecurityContextHolderStrat]]></description><category></category></item><item><title><![CDATA[Java飞行记录器 JRockit Flight Recorder  JFR诊断JVM的历史性能和操作]]></title><link>https://blog.csdn.net/unix21/article/details/52804895</link><guid>https://blog.csdn.net/unix21/article/details/52804895</guid><author>unix21</author><pubDate>Thu, 13 Oct 2016 10:47:42 +0800</pubDate><description><![CDATA[需要展开子树，复制堆栈跟踪，就可以查看到代码调用链，看到自己的业务代码，从而定位到最耗时的代码位置：]]></description><category></category></item><item><title><![CDATA[Map和List静态初始化]]></title><link>https://blog.csdn.net/unix21/article/details/52804577</link><guid>https://blog.csdn.net/unix21/article/details/52804577</guid><author>unix21</author><pubDate>Thu, 13 Oct 2016 10:20:24 +0800</pubDate><description><![CDATA[public final static Map ServerIPMap = new HashMap() {
        {
            put("redis", "127.0.0.1");
            put("solr", "127.0.0.1");
        }
    };


public final static List ComIPList = ]]></description><category></category></item></channel></rss>