download zip of files only
Fri Feb 03 00:10:48 HKT 2012
From /weblog/java/performance
Interestingly, PrintWriter, if pooled, shows considerable performance improvement. The creation of the object is expensive because of a call to get the line separator in its constructor. http://sachinhejip.blogspot.com[..]/08/experiences-in-java-performance.html Experience in twitter - http://www.umbrant.com/blog/2012/twitter_jvm_tuning.html
(google search)
(amazon search)
Thu Feb 02 23:43:14 HKT 2012
From /weblog/java/features
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
(google search)
(amazon search)
Wed Dec 28 23:28:19 HKT 2011
From /weblog/java/fundamental
Java timezone ID reference - http://david.uebelacker.ch[..]etrive-locale-and-timezone-from-request/ http://tutorials.jenkov.com[..]m/java-date-time/java-util-timezone.html setTimeZone affects calls to set(), but doesn’t change the existing Calendar time? So if we wanted to change the time zone we are working with, we have to adjust all the time fields too…but a SimpleDateFormatter still would show it as the current time zone. - http://keyholesoftware.wordpress.com[..]1/joda-time-the-future-of-java-datetime/
(google search)
(amazon search)
Sun Oct 30 02:36:47 HKT 2011
From /weblog/java/hacks
"hi there".equals("cheers !") == true This is because in the JDK 1.3 SUN is caching the hash code so if it once is calculated, it doesn't get recalculated, so if the value field changes, the hashcode stays the same. http://www.artima.com/forums/flat.jsp?forum=106&thread=4864 How to Modifying an Application without Modifying Its Source Code, with {-Xbootclasspath/p:} - http://www.ddj.com[..]M4OQSNDLPCKH0CJUNN2JVN?_requestid=186396 Override string! - http://www.javacodegeeks.com/2011/10/weird-funny-java.html
(google search)
(amazon search)
Wed Oct 19 20:23:53 HKT 2011
From /weblog/java/features
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
(google search)
(amazon search)
Sat Sep 24 00:19:47 HKT 2011
From /weblog/java/concurrency
Another nice tutorial set of concurrency framework - http://www.javacodegeeks.com/search/label/Concurrency Java concurrency, Building and testing concurrent applications for the Java platform - http://www.ibm.com[..]g/kp/j-kp-concurrency/index.html?ca=drs-
(google search)
(amazon search)
Mon Sep 19 00:41:52 HKT 2011
From /weblog/java/features
Develop with real-time Java, Create applications with predictable response times - http://www.ibm.com[..]/training/kp/j-kp-rtj/index.html?ca=drs-
(google search)
(amazon search)
Sun Aug 28 19:58:48 HKT 2011
From /weblog/java/concurrency
Sample code of try-sync import sun.misc.*;
import java.lang.reflect.*;
public class MonitorUtils { private static Unsafe unsafe = getUnsafe();
public static boolean trySynchronize(Object monitor) { return unsafe.tryMonitorEnter(monitor); }
public static void unsynchronize(Object monitor) { unsafe.monitorExit(monitor); }
private static Unsafe getUnsafe() { try { for (Field field : Unsafe.class.getDeclaredFields()) { if (Modifier.isStatic(field.getModifiers())) { if (field.getType() == Unsafe.class) { field.setAccessible(true); return (Unsafe) field.get(null); } } } throw new IllegalStateException("Unsafe field not found"); } catch (Exception e) { throw new IllegalStateException( "Could not initialize unsafe", e); } } } http://www.javaspecialists.eu/archive/Issue194.html
(google search)
(amazon search)
Mon Aug 15 23:40:53 HKT 2011
From /weblog/java/performance
Offline parsing heap dump, good for analysis huge heap dump at server with GTK - http://www.eclipse.org[..]index.php?t=rview&goto=703990#msg_703990 Nice explanation of GC - http://redstack.wordpress.com[..]sualising-garbage-collection-in-the-jvm/ Get call back for memory allocation, should be very useful - http://blogs.lessthandot.com[..]s/applying-kanban-to-it-processes-part-2 Detailed discussion of analysis memory consumption in Java - http://kohlerm.blogspot.com[..]mory-consumption-of-netbeans-versus.html it probably one of the nicest feature of java 5 - dump VM for you to analyst http://blogs.sun.com[..]apdumponoutofmemoryerror_option_in_5_0u7 This article present a simple, and possible not accurate method to track object creation and finalization. May be not that useful in general but sometime is convenience - http://www.devx.com/tips/Tip/30833?trk=DXRSS_JAVA checking memory consumption at object level - http://www.jroller.org[..]im?entry=again_about_determining_size_of Sun contain a nice library for we to investigate heap stat - http://elliotth.blogspot.com[..]om/2005/01/java-equivalent-of-heap1.html Use java.util.Observable to Monitor Object State changes - http://www.devx.com/tips/Tip/22592?trk=DXRSS_JAVA
(google search)
(amazon search)
Mon Jul 25 22:32:16 HKT 2011
From /weblog/java/performance
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 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 Complete list of -XX options from Sun JVM 6 - http://www.md.pp.ru/~eu/jdk6options.html 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
(google search)
(amazon search)
Fri Jun 17 19:16:36 HKT 2011
From /weblog/java/concurrency
Even though private List synchList = Collections.synchronizedList(new LinkedList());
is thread safe, serialize sync List is NOT thread safe for sure. The story is, if you only synchronized the collection, and if we try to get the iterator in concurrent access environment, it will throws currencymodificationexception . I personally think this is a bug of having Collections.synchronizedCollection(). For collection is small, may be making defensive copy http://www.javapractices.com/Topic15.cjp is good. Otherwise, in java5, there is concurrency collection. reference: http://jroller.com[..]ntry=collections_synchronizedlist_broken http://jroller.com/page/ctarrington?entry=java_collections_trivia Map operation, include use of FutureTask and putIfAbsent() method from ConcurrentMap. - http://www.javaspecialists.co.za/archive/newsletter.do?issue=125 Other then lterate through the elements, adding and removing elements can also be problem, this article document a few good cases about that - http://rayfd.wordpress.com[..]en-a-synchronized-class-isnt-threadsafe/ Samples of using Queue.drainTo() - http://binkley.blogspot.com[..]rforming-fixed-amounts-of-work-with.html http://tech.puredanger.com/2009/02/28/java-7-transferqueue/ Overview of blockingqueue - http://tutorials.jenkov.com[..]/java-util-concurrent/blockingqueue.html Simple benchmark - http://java-persistence-performance.blogspot.com[..]jvm-performance-part-iii-concurrent.html Multi-thread behaviour - http://vanillajava.blogspot.com[..]hread-safety-issues-with-vector-and.html
(google search)
(amazon search)
|