2013年11月6日
摘要: show current session id select sid from v$mystat where rownum=1;show blocking session select blocking_session,sid,serial#,wait_class,seconds_in_wait fromv$sessionwhereblocking_session is not NULLorder byblocking_session; 阅读全文
posted @ 2013-11-06 14:32 lpthread 阅读(476) 评论(0) 推荐(0) 编辑
摘要: Basic operationsu - oracle sqlplus / as sysdba show parameter background show parameteruser_dump_dest background_dump_dest: path_to_trace_file deadlook error code is:ORA-00060Refer to dead lock article http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1528515465282one examp... 阅读全文
posted @ 2013-11-06 14:14 lpthread 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 问题 ThreadA invoke ThreadB, and then update DB ThreadB read DB, expect the update DB is finished by ThreadA But in some condition, Thread A update DB is slow, ThreadB have finished and update DB is not started.解决 UseReentrantLock 阅读全文
posted @ 2013-11-06 11:21 lpthread 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 引用 http://www.avricot.com/blog/?post/2010/05/03/Get-started-with-java-JVM-memory-(heap%2C-stack%2C-xss-xms-xmx-xmn...) -Xmx : max heap size (ex: -Xmx4g) -Xms : min heap size. (ex: -Xms2g) -Xmn : the size of the heap for the young generation Young generation represents all the objects which ... 阅读全文
posted @ 2013-11-06 11:12 lpthread 阅读(525) 评论(0) 推荐(0) 编辑
摘要: class MyResource implements Closeable{ @Override public void close() throw IOException{ }}try( myResource = newMyResource() ){ // no need to write finally block to release resource, java will automatially close this resource.}catch(Exception e){} 阅读全文
posted @ 2013-11-06 11:00 lpthread 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 问题 Dead lock in our App under some condition. Both database and application lock contributes to issue. The issue could be simplified to following model. Thread 1: Acquired DB Lock------------------||---------Try to get Application lockThread 2: Acquire Application lock------------||-----------Try .. 阅读全文
posted @ 2013-11-06 10:52 lpthread 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 引用文章Please refer to: http://coolshell.cn/articles/9606.html问题的症状从前我们的Java代码因为一些原因使用了HashMap这个东西,但是当时的程序是单线程的,一切都没有问题。后来,我们的程序性能有问题,所以需要变成多线程的,于是,变成多线程后到了线上,发现程序经常占了100%的CPU,查看堆栈,你会发现程序都Hang在了HashMap.get()这个方法上了,重启程序后问题消失。但是过段时间又会来。而且,这个问题在测试环境里可能很难重现。我们简单的看一下我们自己的代码,我们就知道HashMap被多个线程操作。而Java的文档说Hash 阅读全文
posted @ 2013-11-06 10:39 lpthread 阅读(213) 评论(0) 推荐(0) 编辑