04 2020 档案
摘要:@Override public void run(String... args) throws Exception { ConcurrentHashMap<String, String> concurrentHashMap = new ConcurrentHashMap<>(); concurre
阅读全文
摘要:解释执行:即逐条将字节码翻译成机器码并执行,无需等待编译,非热点代码(80%) 即时执行:将一个方法中包含的所有字节码编译成机器码后再执行,实际运行速度更快,热点代码采用这个方法(20%)。
阅读全文
摘要:max-http-header-size设置 server.max-http-header-size=999999999 //953m JVM参数配置 -Xms800m -Xmx800m 写一个rest api @RestController("action") public class HttpH
阅读全文
摘要:一、Sublist导致OOM 代码 @Slf4j public class SubListDemo { public static void subListOOM() { List<List<Integer>> data = new ArrayList<>(); for (int i = 0; i
阅读全文
摘要:坑1,用Array.asList转换基础类型数组 代码 @Slf4j public class ArrayAsListDemo { public static void intArrayToList() { int[] arr = {1, 2, 3}; List list = Arrays.asLi
阅读全文
摘要:实体类 class Point { private int x; private int y; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y;
阅读全文
摘要:代码 @Slf4j public class StringCompareDemo { public static void compare() { String a = "1"; String b = "1"; log.info("\nString a = \"1\";\n" + "String b
阅读全文
摘要:实例级别的锁 实例代码 @Slf4j public class AddCompareDemo { private int a, b; public void add() { for (int i = 0; i < 10000; i++) { a++; b++; } } public void com
阅读全文
摘要:ThreadLocal ThreadLocal 适用于变量在线程间隔离,而在方法或类间共享的场景。 代码 1 @RestController 2 public class ThreadLocalController { 3 private static final ThreadLocal<Strin
阅读全文
摘要:newFixedThreadPool @Slf4j public class TheadPoolDemo { private static ThreadPoolExecutor threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPoo
阅读全文
摘要:代码 1 @Slf4j 2 public class IntegerCompare { 3 public static void doCompare() { 4 5 Integer a = 127; //Integer.valueOf(127) 6 Integer b = 127; //Intege
阅读全文

浙公网安备 33010602011771号