网络层
运输层
https://www.baidu.com 的 常量.equalsObjects.equals 推荐Java 异常体系
常用关键字
外部类类名.this包装类
add()、remove()、clear()会抛出异常。new ArrayList<>(Arrays.asList("a", "b", "c"))(推荐)泛型数组
T[] arr=new T[10]的方式来创建数组put(null)put(null)getreturn size() > capacity;System.arraycopy() 和 Arrays.copyOf()方法并发基础
start()和run()方法区别UNSAFE.park用quartz<clint>多线程同步加锁sun.misc.Launcher-Xssmax_stacks1:2 6:1:1-Xms -Xmx
-XX:TLABWasteTargetPercent设置-XX:PermSize-XX:MaxPermSize-XX:MetaspaceSize-XX:MaxMetaspaceSize方法区最大大小,默认-1-Xint:完全采用解释器模式执行程序;-Xcomp:完全采用即时编译器模式执行程序。如果即时编译出现问题,解释器会介入执行。-Xmixed(默认):采用解释器+即时编译器的混合模式共同执行程序。-XX:CompileThreshold-XX:CounterHalfLifeTime-XX:-UseCounterDecaySystem.gc()-------------------单核/多核 serial/parnew-XX:SurvivorRatio=8,但是如果不显式设置,实际上Eden : S0 : S1 = 6 : 1 : 1-XX:+UseAdaptivePolicy是开启的-XX:SurvivorRatio=8,才能Eden : S0 : S1 = 8 : 1 : 1-XX:HeapDumpPath=<path>
-XX:OnOutOfMemoryError=/opt/Server/restart.sh
#!/bin/bash
# linux环境
pid=$(pf -ef | grep Server.jar | awk '{if($8=="java"){print $2}}')
kill -9 $pid
cd /opt/Server/;sh run.sh
-
# windows环境
echo off
wmic process where Name='java.exe' delete
cd D:\Server
start run.bat
jvm参数
-
-XX:+PrintCommandLineFlags # 查看命令行相关参数(包含使用的垃圾收集器)
jinfo
-
jinfo -flag 相关垃圾收集器参数 进程ID
非整堆收集垃圾回收器相关参数
-Xloggc:<file>
-XX:ReservedCodeCacheSize=<n>[g|m]k]、-XX:InitialCodeCacheSize=<n>[g|m]k]
基于 xml 的 IOC
基于注解的 IOC
@Beancomponent:scanaop:aspectj-autoproxy@EnableAspectJAutoProxy生命周期
sql标签<parameterMap>—ParameterMap<resultMap>—ResultMap
<select>/<update>/<insert>/<delet>—MappedStatement<select>select _ from studentselect t._ from (select \* from student)t limit 0,10jdbcType=date会导致时间插入时丢失时分秒最左前缀原则
between and;inor%...(覆盖索引有奇效)is null;is not null!=;<>select(只用在 serializable 下考虑)delete/select...for updatebgrewriteaof消息发布订阅
关联:缓存读写策略中的旁路缓存默认禁用