上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 41 下一页

2021年8月9日

归并排序

摘要: package org.example.sort; import java.util.Arrays; /** * @author xianzhe.ma * @date 2021/8/9 */ public class Mergesort { public static void main(Strin 阅读全文

posted @ 2021-08-09 17:14 MaXianZhe 阅读(14) 评论(0) 推荐(0) 编辑

CMS垃圾收集器总结

摘要: 一 公司CMS参数 先说一下公司CMS参数,年轻代3.5G, 其中survivor 50M。老年代1.5G,其实用不到500M,原空间250M。 二 常见参数配置 1 开启 CMS 首先,要说的是,CMS只是老年代的垃圾收集器。其年轻代使用的是ParNew垃圾收集器。 其次,JDK8默认的垃圾收集器 阅读全文

posted @ 2021-08-09 16:06 MaXianZhe 阅读(587) 评论(0) 推荐(0) 编辑

2021年7月26日

桶排序

摘要: public static void bucketSort(int[] arr){ // 计算最大值与最小值 int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; for(int i = 0; i < arr.length; i++){ 阅读全文

posted @ 2021-07-26 10:43 MaXianZhe 阅读(20) 评论(0) 推荐(0) 编辑

快速排序

摘要: private static void quickSort(int[] arr, int low, int high) { if (low < high) { // 找寻基准数据的正确索引 int index = getIndex(arr, low, high); // 进行迭代对index之前和之 阅读全文

posted @ 2021-07-26 09:50 MaXianZhe 阅读(30) 评论(0) 推荐(0) 编辑

2021年7月24日

ThreadLocal的妙用

摘要: ThreadLocal对于工作了多年的老程序员来说,并不陌生。但我想说对于平时做业务代码的人来说,用ThreadLocal的机会并不多。 最近刚接到一个需求,获取HttpRequest中的请求头里的一个参数,并用这个参数作为加密的入参。 考虑到不想大幅度的修改代码,怎么办呢? 强大的组合 Threa 阅读全文

posted @ 2021-07-24 08:41 MaXianZhe 阅读(88) 评论(0) 推荐(0) 编辑

2021年7月8日

NC_41 找最小的k个数

摘要: public class Solution { public ArrayList<Integer> GetLeastNumbers_Solution(int [] input, int k) { ArrayList<Integer> res = new ArrayList<>(k); //根据题意要 阅读全文

posted @ 2021-07-08 07:41 MaXianZhe 阅读(18) 评论(0) 推荐(0) 编辑

2021年7月7日

RocketMq一条消息存储结构

摘要: 除去body长度,Topic的长度,消息属性长度,一条消息至少占用91个字节。真够浪费的。 阅读全文

posted @ 2021-07-07 20:17 MaXianZhe 阅读(72) 评论(0) 推荐(0) 编辑

2021年7月6日

Redis内存淘汰

摘要: 1 内存淘汰是指redis使用的内存超过了配置文件里分配给它的内存大小 maxmemory 1GB 2 什么时候触发 其实,在redis执行每一个命令的时候,都会检查当前的内存是否超过最大内存。如果超过,就会触发 1)客户端执行一条新命令,导致数据库需要增加数据(比如set key value) 2 阅读全文

posted @ 2021-07-06 21:12 MaXianZhe 阅读(105) 评论(0) 推荐(0) 编辑

2021年7月5日

JAVA编程规范

摘要: 1 接口类中的方法和变量都不要加任何的修饰符号,public也不要加。因为经过编译的class文件会自动加上这些 public interface CalInterface { float PI = 3.14159f;//定义用于表示圆周率的常量PI float getArea(float r);/ 阅读全文

posted @ 2021-07-05 20:31 MaXianZhe 阅读(50) 评论(0) 推荐(0) 编辑

2021年7月2日

跟着Rocketmq学习堆外内存

摘要: 刚好看rocketmq关于存储的源码, org.apache.rocketmq.store.MappedFile MappedFile#init private void init(final String fileName, final int fileSize) throws IOExcepti 阅读全文

posted @ 2021-07-02 18:07 MaXianZhe 阅读(412) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 41 下一页

导航