Latest Entries »

JVM 崩溃分析

首先查看 syslog(可以看到是否被系统kill等其他信息) 发现没权限...

只有crash日志,那从上往下如下

错误的概要介绍 分析 ------
SIGSEGV (0xb) at pc=0x00007fce0a3e3bcf, pid=9562, tid=140508990830336
其中 重要的几个参数

View full article »

git遇到的问题

在公司自己搭建的gitlab下拉取代码总是报错
fatal: unable to access 'xxxxxxxx.git/': SSL certificate problem: Invalid certificate chain

后找到解决方案
if you use self generated ssl key, you can try this.

git config --global http.sslVerify false

之前在时候看书上都推荐用Collections.synchronizedMap()来保证thread-safety当时就在想为啥不用ConcurrentHashMap;
然后看了下面这篇文章,讲的还是非常清晰的,所以摘抄过来,原文地址http://www.pixelstech.net/article/1394026282-ConcurrentHashMap-vs-Collections-synchronizedMap()

View full article »

缘起于看某一个类时候注意到的Arrays.copy,以前一直用,却没仔细进去瞅瞅

public static void sort(long[] a) {
    DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}

DualPivotQuicksort初步看上去是快排的一种,查阅了一下,复杂度是nlogn,但大规模经验数据证明整体性、稳定性不错,引用看到的评论所说:"And this is why we are extremely grateful to the Java Library designers that we don't have to implement our own sorting algorithms, otherwise we'd all be using bubble sort ;-) "

View full article »

原文链接http://stackoverflow.com/questions/11208479/how-do-i-initialize-a-byte-array-in-java
有如下几种
1.jdk6

private static final byte[] CDRIVES = javax.xml.bind.DatatypeConverter.parseHexBinary("e04fd020ea3a6910a2d808002b30309d");

View full article »

Powered by Typecho. Theme: Motion modified by changyuefeng.版权所有ICP证:浙ICP备20011766号