Java Performance Tuning

Java Performance Tuning

Latest news

NEW: MARCH NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “We’re likely to see cloud infrastructure that hosts containers directly without the underlying VM, giving an extra efficiency to running in a container if you’re cloud based – because the container has lower overhead than a cloud virtual machine, so you’ll benefit with no real cost!”
  • All the latest Java performance tips extracted in concise form
    • “A docker image with the full JDK is around 0.5GB. With JDK9+ you can create custom JREs with just the subset of the JDK you need (jdeps tool helps identify which modules an application uses). A minimal JRE containing only the java.base module, eg ‘ jlink –module-path /docker- java-home/jmods –strip-debug –compress=2 –output java –add-modules java.base’ with alpine linux and the musl-libc library in the image results in an image of less than 50MB in size (an order of magnitude smaller). (This is maintained in project Portola)”

FEBRUARY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “All the Java 10 performance features, with details of how to use them”
  • All the latest Java performance tips extracted in concise form
    • “It’s 2018, not 1999 – your systems can easily handle the miniscule load of an agent based monitoring tool, and these are much more flexible than agentless ones”

JANUARY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “OpenJDK VM, HotSpot, GraalVM, OpenJ9, Excelsior JET, interesting choices”
  • All the latest Java performance tips extracted in concise form
    • “VarHandle memory ordering modes from weakest to strongest: Plain, Opaque, Release/Acquire, Volatile. Plain can be reordered and eliminated like an ordinary r/w for a field. Opaque writes are eventually seen. Release/Acquire ensures ordering is maintained for the field. Volatile ensures sequential consistency across multiple fields”

DECEMBER NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “10 000 tips over more than 15 years and over 20 million page views”
  • All the latest Java performance tips extracted in concise form
    • “Volatile variables which are shared across cores can slow down processing if they are accessed and updated frequently because each core has to invalidate the other core caches when it is changed, stalling core processing”

NOVEMBER NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “If you really do need to build thread-safety yourself, do it in an encapsulated way, eg with all the multi-threaded management of access and updates to your data structures hidden behind class APIs so that fixes can be applied internally with no need for the external users to have to change their usage”
  • All the latest Java performance tips extracted in concise form
    • “Caches losing a small percentage of data can mean a large increase in datstore load (eg 95% hit ratio dropping to ->90% means that DB load goes from 5%->10% – a doubling of load; the same 5% drop from 99.5%->94.5% means that DB load goes from 0.5%->5.5% – a 10x increase in DB load)”

OCTOBER NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “the problem with most asynchronous programming frameworks (Actors, Fork-join, etc) is that when you go to debug an issue, you get thrown into the framework rather than your use of the framework, and this makes debugging hugely more difficult than debugging synchronous execution”
  • All the latest Java performance tips extracted in concise form
    • “If building SoftReference cache (typically has values wrapped inside a SoftReference), Brian Goetz suggests instead wrapping the whole cache in a SoftReference, ie the whole whole cache is dumped under memory pressure – any elements with hard references outside the cache in the main app will stay anyway, and this frees up a lot more memory quickly”

SEPTEMBER NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “Encapsulate your data structures – this is best practice for coding, for maintenance, and performance (you make the underlying implementation more efficient without having to change anything in the rest of the application).”
  • All the latest Java performance tips extracted in concise form
    • “The four refinement zones (white green yellow red) affect how much work G1 needs to do to update queued pointer changes into the remembered sets. In the white zone, nothing is done (it’s drained at the beginning of a GC); in the green zone -XX:G1ConcRefinementGreenZone refinement threads are activated to reduce the queue back to the white zone; in the yellow zone -XX:G1ConcRefinementYellowZone all refinement threads are fully active to reduce the queue; in the red zone -XX:G1ConcRefinementRedZone the application has to update the remembered sets on each pointer change which slows down the application until the queue is back into the yellow zone.”

AUGUST NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “For concurrency, good coding practice competes with good performance – the solution to this dilemma is to factor in the amount of concurrency needed”
  • All the latest Java performance tips extracted in concise form
    • “Biased locking is good for un-contended locks, but is worth disabling (-XX:-UseBiasedLocking) if there is contention (monitor with -XX:+PrintSafepointStatistics -XX:+PrintGCApplicationStoppedTime which let’s you see safepoint statistics for stopped times)”

JULY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “Seriously horizontally scaled applications monitor the performance of each virtual server and actually shutdown services when they detect sufficient contention for resources from competing virtual containers using the shared hardware”
  • All the latest Java performance tips extracted in concise form
    • “Inner classes need to have access to their outer class – if the inner class instance continues to be live when the outer class instance is completed, the outer class instance will be kept alive leading to a possible memory leak. One possible solution is to hold the outer class reference in a weak reference. “

JUNE NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “The ‘concurrency, data size and responsiveness’ 3 axes of performance are particularly useful for characterising the need for performance and memory efficiency during development: they tell you when you need to go beyond good coding practices to achieve performance goals”
  • All the latest Java performance tips extracted in concise form
    • “5 ways to do atomic optimistic reads on multiple fields are: StampedLock, AtomicReference, AtomicReferenceFieldUpdater, Unsafe, VarHandle.”

MAY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “The slides are available and give you a fairly complete grounding in how to handle all the most common types of performance and memory problems”
  • All the latest Java performance tips extracted in concise form
    • “GPUs are suitable where the problem can be massively parallelized, and there is a lot of data that needs processing. Machine learning is an excellent example. GPUs excel at running multiples of the same operation at once.”

APRIL NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “‘ParNew + SerialOld : -XX:+UseParNewGC’, was the optimal garbage collector combination if you were targeting footprint size in bi-stable heaps”
  • All the latest Java performance tips extracted in concise form
    • Java 9 recommended GC logging parameters are -Xlog:gc*,gc+ref=debug,gc+age=trace,gc+heap=debug:file=gc%p%t.log:tags,uptime,time:filecount=10,filesize=10m (you may need to delete some options for your use)”

MARCH NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “If you really want to have memory-pressure sensitive cache, encapsulate your preferred cache and add separate functionality which detects memory pressure with SoftReference instance just for that”
  • All the latest Java performance tips extracted in concise form
    • “Typical tuning options at the CPU level include: reduce the number of instructions needed to execute the algorithm; change the data structure to reduce memory stalls (waiting for memory); change the program logic to reduce branch stalls (eg from mispredicted branches); change the order of operations so that they execute in parallel across the cores more easily (if in a loop each subsequent operation depends on the result of the last one, this is difficult); breakdown long latency operations into multiple simpler ones”

FEBRUARY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “Getting a heap dump is straightforward, you can use any of jmap; the JMX com.sun.management.HotSpotDiagnostic.dumpHeap() method (from any JMX aware tool, such as jconsole); the -XX:+HeapDumpOnOutOfMemoryError flag (which does what it says); and jcmd [PID] GC.heap_dump [PATH_TO_DUMPFILE]”
  • All the latest Java performance tips extracted in concise form
    • “jvmstat includes several hundred indicators covering nearly all JVM areas: class loading, garbage collection, multithreading, just-in-time compilation, etc. jvmstat counters are free – Java HotSpot VM exports them anyway, whether you read them or not, in the file system as a memory-mapped file in a temporary directory, by default /tmp/hsperfdata_{user}/{pid}, where {pid} is the JVM process ID”

JANUARY NEWSLETTER

  • We list all the latest Java performance related news and articles
    • “I’ll be giving a talk at this years Devoxx UK on what I’ve learned about Java performance tuning over the 15 years of these newsletters”
  • All the latest Java performance tips extracted in concise form
    • “If you are considering timescales of 10 microseconds and lower, you need to architect for cores to run independently – so you need to understand the data in the shared CPU cache, and use thread affinity to keep specific operations on specific cores”

Previous newsletters

All our previous newsletters can be viewed from here

How to use this site

This site has four main information resources:

  • The uncategorized tips page lists many other web pages with Java performance tuning related information. Each web page has its performance tuning tips extracted and listed immediately after the URL is listed. These tips are being categorized, and the tips page links to those categories currently available. If the performance area you are interested in is not yet categorized, send us an emailfrom this page telling us the categorization you’d like to see. In any of the tips pages, use your browser’s “find” or “search” option to identify particular tips you are interested in on the page, and follow up by reading the referenced web page if necessary or desired.
  • The resources page lists Java performance tuning resources including books, tools, reports, other performance tuning sites of interest, and Java performance tuning discussion groups.
  • The news pages are monthly newsletters listing any new Java performance tuning related information, together with Kirk Pepperdine’s discussion group roundup and Javva The Hutt.
  • The tool reports pages are detailed introductory reports on various Java performance related tools, for both free and commercial tools.

来源: Java Performance Tuning

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
97 views

发表评论

电子邮件地址不会被公开。 必填项已用*标注

跳至工具栏