waterye

#

-XX:+UseConcMarkSweepGC

系统这两天出现了长时间的full gc, 使用-XX:+UseConcMarkSweepGC后,系统正常
 
5.4 The Concurrent Low Pause Collector
The concurrent low pause collector is a generational collector similar to the serial collector. The tenured generation is collected concurrently with this collector.
This collector attempts to reduce the pause times needed to collect the tenured generation. It uses a separate garbage collector thread to do parts of the major collection concurrently with the applications threads. The concurrent collector is enabled with the command line option -XX:+UseConcMarkSweepGC. For each major collection the concurrent collector will pause all the application threads for a brief period at the beginning of the collection and toward the middle of the collection. The second pause tends to be the longer of the two pauses and multiple threads are used to do the collection work during that pause. The remainder of the collection is done with a garbage collector thread that runs concurrently with the application. The minor collections are done in a manner similar to the serial collector although multiple threads are used to do the collection. See "Parallel Minor Collection Options with the Concurrent Collector" below for information on using multiple threads with the concurrent low pause collector.
The techniques used in the concurrent collector (for the collection of the tenured generation) are described at:
http://research.sun.com/techrep/2000/abstract-88.html


http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

print gc.log
-verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution

posted @ 2007-12-28 19:41 waterye 阅读(4739) | 评论 (0)编辑 收藏

hashmap引起的high cpu

系统运行一段时间后老是出现爆cpu的情况,通过jconsole查看jvm,原来是hashmap引起的,系统使用hashmap作为cache容器.

替换成高并发访问下性能更好的ConcurrentHashMap并调整实际的initialCapacity就可以解决爆cpu的问题.

posted @ 2007-12-22 18:26 waterye 阅读(549) | 评论 (0)编辑 收藏

ps set screen width

ps -ef --width 2000

posted @ 2007-12-14 00:32 waterye 阅读(319) | 评论 (0)编辑 收藏

使用iptables限制ip

iptables -I INPUT -s 66.249.89.147 -j DROP

posted @ 2007-11-20 00:00 waterye 阅读(1060) | 评论 (2)编辑 收藏

lftp upload

lftp -e "cd /home/root; mirror -R $DIRNAME; quit" -u root,$2 sftp://$1

posted @ 2007-11-05 22:47 waterye 阅读(341) | 评论 (0)编辑 收藏

无题

周一公司搬家,临时使用网通的宽带,可惜公司的服务器放在电信机房.网通连电信实在让人无法忍受,还好google到netpas,果然好用,试用后注册成包月用户(15元/月).哎,上网舒服多了.

posted @ 2007-08-09 23:11 waterye 阅读(473) | 评论 (1)编辑 收藏

检测进程是否存在

#!/bin/sh

while :
do
    PID=`cat /home/pid.file`
    RUN_FLAG=`ps -p $PID | awk -v var=$PID '$1==var { print "1" }'`
   
    if [ -n "$RUN_FLAG" ] # string is not "null".
      then
        echo 'running' # running
      else
        echo 'kao' # restart process
    fi
   
    sleep 60 # 1 minute
done

posted @ 2007-07-09 21:47 waterye 阅读(1082) | 评论 (0)编辑 收藏

traditional FTP client upload script

for f in $UPLOADDIR
do
if [ -f $f ]; then
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
ascii
put ${f##*/}
END_SCRIPT
fi
done

当然使用其他ftp client更加方便

http://www.columbia.edu/kermit/ftpscripts.html

posted @ 2007-06-17 01:53 waterye 阅读(611) | 评论 (0)编辑 收藏

date format

date +%Y-%m-%d
DIRNAME=$(date +%Y-%m-%d)
echo $DIRNAME

posted @ 2007-06-17 01:49 waterye 阅读(648) | 评论 (0)编辑 收藏

echo filename

Given:
foo=/tmp/my.dir/filename.tar.gz
We can use these expressions:
path = ${foo%/*}
To get: /tmp/my.dir (like dirname)
file = ${foo##*/}
To get: filename.tar.gz (like basename)
base = ${file%%.*}
To get: filename
ext = ${file#*.}
To get: tar.gz

http://linuxgazette.net/issue18/bash.html

posted @ 2007-06-17 01:47 waterye 阅读(528) | 评论 (0)编辑 收藏

仅列出标题
共18页: 上一页 1 2 3 4 5 6 7 8 9 下一页 Last