RSS feed [root] /weblog /java




login:

password:

title search:




 


Tue Jan 22 09:36:31 HKT 2013

java



(google search) (amazon search)
second
download zip of files only

Wed May 08 00:57:08 HKT 2013 From /weblog/java/tools

dev


Generate a diff page forother toreview in HG - https://blogs.oracle.com/bondolo/entry/how_i_generate_a_webrev

(google search) (amazon search)


Mon Mar 25 21:00:46 HKT 2013 From /weblog/java/performance

leak


List some common causes of memory leak in application restart. - http://www.patrickpeak.com[..]/Weblog/your_web_app_is_leaking#comments http://blog.dynatrace.com[..]/20/the-top-java-memory-problems-part-1/

Incorrect use of threadlocal - http://www.szegedi.org/articles/memleak.html

Memory leak if load JDBC class incorrectly - http://www.szegedi.org/articles/memleak2.html

Serialization and ResourceBundle issue from core library (fixed) - http://www.szegedi.org/articles/memleak3.html

PermHeap bloat in and only in server VM - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4957990

String.subString() still held a big big char[] - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513622

One pitfall of URLClassLoader, it cause leak from classloader, which is not obvious from the code - http://www.zeroturnaround.com/blog/rjc201/

Steps of finding out a memory leak by native code - http://web.archiveorange.com[..]e/v/Dp7Rf33tij5BFBNRpVja#YnJRjM4IVyt54TV

(google search) (amazon search)


Sat Mar 02 18:50:50 HKT 2013 From /weblog/java/tools

monitoring


Support of JMX from common java library - http://www.javacodegeeks.com[..]ling-jmx-in-hibernate-ehcache-qurtz.html

sample code show how to get vm info at jmx - http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm

An excellent short tutorial of JMX - http://java.sun.com/developer/technicalArticles/J2SE/jmx.html

Monitoring all tomcat 5 JMX information, with free tools and java startup config - http://jroller.com[..]illiams/20050202#monitoring_tomcat_5_5_x

Task manager like jconsole plugin - http://blog.luminis.nl[..]is/entry/top_threads_plugin_for_jconsole

Performance cost of JMX - http://weblogs.java.net[..]nus/archive/2006/07/how_much_does_i.html

Monitoring Local and Remote Applications Using JMX 1.2 and JConsole - http://onjava.com/lpt/a/5226

Collections of tools - http://www.javacodegeeks.com[..]/client-side-server-monitoring-with.html

remote conenction with ssh - http://theholyjava.wordpress.com[..]nitoring-remote-jvm-over-ssh-jmx-or-not/

IBM healthcare API - http://www.ibm.com[..]rary/j-healthcareapi1/index.html?ca=drs- http://www.ibm.com/developerworks/java/jdk/tools/healthcenter/

(google search) (amazon search)


Thu Feb 21 09:29:49 HKT 2013 From /weblog/java/features

debugging


VisualVM , a collection of tools for debugging and monitoring - http://www.infoq.com/news/2008/05/visualvm

Presentation of BTrace, which allow user to have event base tracing - https://btrace.dev.java.net[..]ts/8510/98299/BTrace_BOF-5552_J12008.pdf

JDK command line tools which help to solving memory issue - http://plumbr.eu/blog/solving-outofmemoryerror-jdk-tools

Show how to get stack trace and memory map from JVM dump - http://fahdshariff.blogspot.gr[..]gr/2012/08/analysing-java-core-dump.html

(google search) (amazon search)


Wed Feb 20 18:12:48 HKT 2013 From /weblog/java/libraries

log


Good thing about LogBack - http://www.infoq.com/news/2007/08/logback

(google search) (amazon search)



Mon Feb 11 11:48:38 HKT 2013 From /weblog/java/performance

hotspot


How can jruby take advantage of hotspot - http://headius.blogspot.com[..]nderstanding-jvm-jit-and-helping-it.html

Discussion about OOME - http://www.codingthearchitecture.com[..]01/14/jvm_lies_the_outofmemory_myth.html

How hotspot optimization ofoptimzate Polymorphism - http://blogs.azulsystems.com/cliff/2008/03/another-round-o.html

List of tools - http://www.jroller.com/lmchung/entry/java_performance_tools

an issue of hotspot but haven't handle in 5 year - http://bugs.sun.com/view_bug.do?bug_id=6186134

A test for how hotspot inline method - http://java.dzone.com/articles/how-aggressive-method-inlining http://nurkiewicz.blogspot.com.au[..]ggressive-is-method-inlining-in-jvm.html

(google search) (amazon search)


Mon Feb 11 11:47:44 HKT 2013 From /weblog/java/discussion

idea of improving java language


These look interesting, worth to take a look:

1) Auto null checking: http://www.jroller.com[..]ebourne?entry=adding_auto_null_checks_to
I don't think this is a good idea as I don't think there is a way can handle default object reference more generic then NULL. However, I would like to have a way to customize NULL behaviour (or default NULL object). Say, for String, I will think empty string ("") is same as NULL. Thus, I would like to have define something like:

public final class Strinig {
null {
return "";
}
// the rest of string implementation
}

Then the default reference of String, rather than point to NULL, now it point to an empty String.

2) Add closure to Java: http://www.jroller.com[..]ebourne?entry=adding_closures_to_java_or
Not much comment, it is something nice to have but I don't think really add a lot of value, just like java5 foreach loop.

3) Auto casting: http://jroller.com[..]lebourne?entry=adding_auto_casts_to_java
I guess generic already does this?

Of course, there are still some other problem on some people's mind, like:
http://www.onlamp.com/lpt/a/3691
http://nice.sourceforge.net/safety.html

On the other hand, somebody don't like to change java language as it probably make your code less portable. http://www.eclipsezone.com/eclipse/forums/t54318.html

4) Some idea of useful util language - http://closingbraces.net/2007/03/05/strangelets/

5) API for adding feature - http://www.theserverside.com[..]s?track=NL-461&ad=636686&thread_id=49035

A lot more other idea - http://blog.jooq.org/2013/02/04/java-if-this-were-a-better-world/

Drop extends - http://www.javaworld.com[..]at-if-java-8-dropped-extends.html?page=2

(google search) (amazon search)


Wed Feb 06 17:32:04 HKT 2013 From /weblog/java/features

lambdas


Introduction of Lambdas expression in Java - http://zeroturnaround.com/labs/java-8-the-first-taste-of-lambdas/

(google search) (amazon search)


Wed Feb 06 08:01:16 HKT 2013 From /weblog/java/fundamental

memory


From java code to java heap, detail of how java use memory - http://www.ibm.com[..]rks/java/library/j-codetoheap/index.html

Algorithm of determine suitable thread pool size - http://www.javacodegeeks.com[..]reading-stories-about-robust-thread.html

Detail of how to analysis how much memory you need - http://www.javacodegeeks.com[..]m/2012/12/how-much-memory-do-i-need.html

Chinese introduction of memory model - http://www.infoq.com/cn/articles/java-memory-model-1

Difference between PermGem and MetaSpace - http://javaeesupportpatterns.blogspot.com.au[..]02/java-8-from-permgen-to-metaspace.html

(google search) (amazon search)


Wed Feb 06 08:00:03 HKT 2013 From /weblog/java/fundamental

collections


Detailed decision of arraylist and linkedlist, consist of a lot benchmark results, take a look if interested: http://javachaos.crazyredpanda.com/?p=99

One bug from java HashMap explaining it can be difficult to achieve fail-fast - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6625725 http://java.dzone.com/articles/do-your-iterators-always-fail

Performance difference of difference collection - http://java-persistence-performance.blogspot.com[..]0/12/what-is-faster-jvm-performance.html http://leolewis.website.org[..]/2011/07/14/java-collection-performance/

A treelist implementation - http://binkley.blogspot.com/2007_02_01_archive.html

Implement LRU cache using LinkedHashMap - http://vanillajava.blogspot.com[..]11/06/java-secret-lru-cache-in-java.html

Problem of using soft-reference for automate cache clean up - http://comments.gmane.org[..]gmane.comp.java.jsr.166-concurrency/7982

if it claims that an element is contained in it, this might be in error, but if it claims that an element is not contained in it, then this is definitely true. - http://codingjunkie.net/guava-bloomfilter/

Comment of various collections library - http://plumbr.eu/blog/selecting-your-collections-library

List of FAQ of Java collections - http://www.journaldev.com[..]lections-interview-questions-and-answers

(google search) (amazon search)


Mon Feb 04 10:29:39 HKT 2013 From /weblog/java/performance

memory


Will you get any performance improvement if you manage memory yourself? - http://mentablog.soliveirajr.com[..]ne-is-faster-java-heap-or-native-memory/

More heap, GC will get slower - http://plumbr.eu[..]ing-heap-size-beware-of-the-cobra-effect

Collection of tools to analysis GC activities - http://www.fasterj.com/tools/gcloganalysers.shtml

Another presentation of performance hint for hotspot or memory - http://www.infoq.com/presentations/Extreme-Performance-Java

Show how to enable and analyze the verbose:gc out data - http://javaeesupportpatterns.blogspot.com.au[..]3/01/java-verbose-gc-tutorial-video.html

(google search) (amazon search)


Mon Jan 28 08:59:25 HKT 2013 From /weblog/java/concurrency

Lock


ReentrantReadWriteLock - http://www-128.ibm.com[..]loperworks/library/j-jtp10264/index.html

why it suppose to be faster than VM level lock - http://osdir.com[..]sr.166-concurrency/2005-02/msg00031.html and a test about it - http://mechanical-sympathy.blogspot.gr[..]r/2011/11/java-lock-implementations.html

Samples of how to use it, and how to write test cases about it - http://www.javaspecialists.eu/archive/Issue152.html

Some useful VM parameter to tune the locks: -XX:+EliminateLocks , -XX:+DoEscapeAnalysis , -XX:+UseBiasedLocking - http://work.tinou.com[..]locking-escape-analysis-for-dummies.html

Discuss about 3 difference lock for Java, bias, thin and fat - http://www.javacodegeeks.com/2011/05/how-jvm-handle-locks.html

Why using the read lock will make lock detector fail - http://javaeesupportpatterns.blogspot.com.au[..]concurrency-hidden-thread-deadlocks.html

(google search) (amazon search)


Wed Jan 23 12:28:17 HKT 2013 From /weblog/java/concurrency

threadlocal


There is a little bit performance cost for threadlocal variable - http://software.intel.com[..]ost-of-accessing-thread-local-variables/

Look like a useful but less known API - http://crazybob.org/2006/07/hard-core-java-threadlocal.html

Forward up discussion - http://www.theserverside.com[..]d_id=41473&asrc=EM_NNL_406677&uid=703565 pointing out some problems of using this technique, include similar effect of GLOBLE , possible memory leak

Another discussion in higher level - http://blog.objectmentor.com[..]04/thread-local-a-convenient-abomination , Key is "An object is an abstraction of function. A thread is an abstraction of schedule" , you can read further conclusion at http://www.infoq.com/news/2007/09/confusing_uow_with_threads

Protential issue of using threadlocal, one is memory leak and the other is it is that local - http://blog.maxant.co.uk/pebble/2008/09/23/1222200780000.html http://www.javacodegeeks.com[..]hreading-stories-threadlocal-in-web.html
http://plumbr.eu[..]shoot-yourself-in-foot-with-threadlocals

(google search) (amazon search)


Tue Jan 22 09:37:48 HKT 2013 From /weblog/java/tools

memory


How to use Eclipse Memory Analyzer - http://eclipsesource.com[..]s-for-using-the-eclipse-memory-analyzer/

(google search) (amazon search)


Mon Jan 21 07:56:32 HKT 2013 From /weblog/java/fundamental

process


Execute and manage an external process from within Java - http://developer4life.blogspot.com.au[..]cuting-command-line-executable-from.html

(google search) (amazon search)


Sun Jan 20 01:58:05 HKT 2013 From /weblog/java/fundamental

string


Substring no longer just change offset - http://www.javaadvent.com[..]hanges-to-stringsubstring-in-java-7.html

(google search) (amazon search)


Sat Jan 05 23:52:39 HKT 2013 From /weblog/java/features

reflection


Good : dynamic, generic
Bad: slow, don't work with Obfuscators and most searching and refactoring tools

http://jroller.com/page/ie?entry=time_to_reconsider_reflection

A very nice tool to get parameter name - http://paranamer.codehaus.org/ (e.g.: user of getUser(User user))

How to improve the performance - http://coding-masters.blogspot.com[..]-reflection-as-fast-as-direct-calls.html

The problem of using reflection to modify final field - http://www.azulsystems.com[..]7-writing-to-final-fields-via-reflection

Using reflection for using test - http://www.javaadvent.com[..]f-hacking-enums-and-modifying-final.html

(google search) (amazon search)


Sat Jan 05 13:18:39 HKT 2013 From /weblog/java/performance

synchronization


An example about improving performance by replace synchronized with volatile - http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fecba6a8b78e

Log4j can have deadlock due to performance - http://javaeesupportpatterns.blogspot.com.au[..]09/log4j-thread-deadlock-case-study.html

There is always some cost for synchronization - http://vanillajava.blogspot.com.au[..]-synchronization-be-optimisede-away.html

(google search) (amazon search)


Sat Jan 05 10:27:24 HKT 2013 From /weblog/java/fundamental

finalization


http://java.sun.com[..]r/technicalArticles/javase/finalization/

Pitfall and solution of implementing finalize(), if you really need it http://www.hpl.hp.com[..]ns_Boehm/misc_slides/java_finalizers.pdf

Optimization-robust finalization - http://www.open-std.org[..]C1/SC22/WG21/docs/papers/2007/n2261.html

An example showing that memory leak caused by finalize() - http://vanillajava.blogspot.com.au[..].com.au/2012/12/object-resurrection.html

(google search) (amazon search)


Tue Jan 01 18:07:14 HKT 2013 From /weblog/java/performance

option list


Using generational & concurrent GC collector - http://www.javacodegeeks.com[..]/04/ibm-jvm-tuning-gencon-gc-policy.html

Full VM option list : http://blogs.sun.com/roller/resources/watt/jvm-options-list.html, update for Java7 - http://nerds-central.blogspot.com[..]ot.com/2011/07/all-jvm-7-xx-options.html http://stas-blogspot.blogspot.com[..]ost-complete-list-of-xx-options-for.html

HotSpot JVM garbage collection options cheat sheet - http://aragozin.blogspot.com[..]spot-jvm-garbage-collection-options.html http://www.oracle.com[..]va/javase/tech/vmoptions-jsp-140102.html

An example and story about effect of difference VM parameter affecting the performance - http://www.javaspecialists.eu/archive/Issue191.html

Clear the code cache automatically with -XX:+UseCodeCacheFlushing - http://blogs.amd.com[..]time-for-long-running-java-applications/

Discussion about -XX:MinHeapFreeRatio parameter - http://www.gossamer-threads.com[..]s.com/lists/lucene/java-user/44286#44286

The other detailed guide for VM parameters tuning - http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

Here is a more simple cookbook - http://java.sun.com/performance/reference/whitepapers/tuning.html

A outdated (1.4) , compehensive but still not really too detailed, overview of various GC tuning - http://www.petefreitag.com/articles/gctuning/

Some say following VM parameter is good enough
-server -Xmx -XX:+UseParallelGC
http://blogs.sun.com[..]/page/binublog?entry=java_tuning_for_xml

Some say is useful if you have huge memory
-XX:+UseLargePages
http://blogs.sun.com[..]dagastine?entry=java_se_tuning_tip_large

Some say below parameter keep GC in low pause
-XX:MaxGCPauseMillis=5000
Some say below parameter are very optimal
-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:NewSize=1200m -XX:SurvivorRatio=16
http://www.theserverside.com[..]d.tss?thread_id=41258&ASRC=EM_NNL_347804
Some say those parameter is good
-XX:+UseConcMarkSweepGC
-XX:ParallelCMSThreads=1
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:CMSIncrementalDutyCycle=10
http://blog.mikiobraun.de/2010/08/cassandra-gc-tuning.html

Just in case anyone is curious, the flags enabled by -XX:+AggressiveOpts in JDK 1.6.0_25 are:

-XX:+EliminateAutoBox
-XX:AutoBoxCacheMax=20000
-XX:BiasedLockingStartupDelay=500
-XX:+DoEscapeAnalysis
-XX:+OptimizeStringConcat
-XX:+OptimizeFill

Generate dump with OOME - -XX:+HeapDumpOnOutOfMemoryError

GC log sample of -XX:+UseConcMarkSweepGC -XX:PrintFLSStatistics=1 -XX:+PrintGCDetails - https://gist.github.com/1329783

A case study of tuning VM GC parameters - http://plumbr.eu[..]ld-you-trust-the-default-settings-in-jvm

(google search) (amazon search)


Tue Jan 01 10:27:27 HKT 2013 From /weblog/java/eclipse

plugins


Good decompiler - http://mchr3k.github.com/jdeclipse-realign/

fatjar - http://kurucz-grafika.de/fatjar

And my old stuff - https://carfield.tadalist.com/lists/18316

(google search) (amazon search)


Tue Jan 01 10:18:52 HKT 2013 From /weblog/java/features

image analysis


Using OpenCV to detect palm - http://www.javaadvent.com[..]d-and-finger-detection-using-javacv.html

(google search) (amazon search)


Tue Dec 25 21:14:19 HKT 2012 From /weblog/java/discussion

default


Use annotation for default data, rather than hard code it - http://blog.joda.org/2012/12/annotating-jdk-default-data.html

(google search) (amazon search)


Sun Dec 23 00:57:55 HKT 2012 From /weblog/java/features

IO


Watch service, watch if directory changed - http://www.javacodegeeks.com/2012/02/java-7-watchservice.html

Tips of using bytebuffer - http://worldmodscode.wordpress.com[..]2/14/the-java-bytebuffer-a-crash-course/

(google search) (amazon search)