RSS feed [root] /java /weblog




login:

password:

title search:




 


Sat Sep 28 10:12:49 GMT 2024

java



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

Tue Jan 09 10:53:31 GMT 2024 From /weblog/java/performance

gc


Debugging RAM: Java Garbage Collection - Java Heap Deep Dive, Part 1 - https://talktotheduck.dev[..]ge-collection-java-heap-deep-dive-part-1

Concurrent Marking in G1 - https://tschatzl.github.io/2022/08/04/concurrent-marking.html

What Should I Know About Garbage Collection as a Java Developer? - https://foojay.io[..]t-garbage-collection-as-a-java-developer

JDK 21: The GCs keep getting better - https://kstefanj.github.io[..]/jdk-21-the-gcs-keep-getting-better.html

(google search) (amazon search)


Wed Sep 06 13:46:21 GMT 2023 From /weblog/java/concurrency

Thread


An API to get the state of a thread, but someone say it is not reliable - http://java.sun.com[..]5.0/docs/api/java/lang/Thread.State.html http://java.silke-wingens.de/2011/03/13/threads-states/?lang=en

http://www.nabble.com[..]readed-programs-tf3627394.html#a10128844

Having said that, I have to note that using Thread#getState() is not
something you can absolutely rely on as the behavior isn't guaranteed
to be the same on all platforms. That is, it can be a useful tool for
debugging and test-driving but not ideal for regression (unit)
testing.

Overview of Java thread - http://java67.blogspot.hk[..]t-thread-and-javalangthread-in-java.html

Loom - https://webtide.com/do-looms-claims-stack-up-part-1/ https://webtide.com/do-looms-claims-stack-up-part-2/

How will we debug Loom applications? - https://www.reddit.com[..]drv/how_will_we_debug_loom_applications/

Question: Why exactly are fibers cheaper than platform threads? - https://www.reddit.com[..]ion_why_exactly_are_fibers_cheaper_than/

Handling Virtual Threads - https://dzone.com/articles/handling-virtual-threads

1. Avoid Synchronized Blocks/Methods
2. Avoid Thread Pools To Limit Resource Access
3. Reduce ThreadLocal Usage
https://dzone.com[..]o-avoid-when-switching-to-virtual-thread

Exploring the design of Java’s new virtual threads - https://blogs.oracle.com/javamagazine/post/java-virtual-threads

(google search) (amazon search)


Sat Jul 01 14:23:08 GMT 2023 From /weblog/java/performance

profiler


http://java-performance.info/introduction-jmh-profilers/

Another blog of discussion of difference profiler - http://blog.orange11.nl/2012/03/13/java-profiler-comparison/

Introduction to jmap, visualvm and btrace - http://www.infoq.com/articles/java-profiling-with-open-source

JMP http://www.khelekore.org/jmp/ is an easy to setup and provide real time data choice. However it will crash JVM occasionally. So may be the one using web interface is better for us: http://oss.metaparadigm.com/jmemprof/

Articles -
Onjava - http://www.onjava.com/lpt/a/6689
Eclipsecolorer profiler, however that plugin require you install binary yourself, somehow tedious if you move from one machine to another machine - http://www.theserverside.com[..]tss?l=EclipseProfiler&asrc=EM_NLN_476666

A total java version of profiler!!: http://jiprof.sourceforge.net

Few other profiler haven't get time to try:
Free:
http://jcoverage.sourceforge.net/
http://www.tagtraum.com/gcviewer.html
http://profiler4j.sourceforge.net/
http://www.jamonapi.com

Eclipse plugin:
http://jmechanic.sourceforge.net/
http://eclipsecolorer.sourceforge.net/index_profiler.html
http://www.eclipse.org/mat/

Need $$:
http://www.ej-technologies.com/products/jprofiler/overview.html

See if the information useful.

How to measure with less than milli second - http://www.rationaljava.com[..]15/10/measuring-microsecond-in-java.html

Unleash the Power of Open Source Java Profilers: Comparing VisualVM, JMC, and async-profiler - https://www.infoq.com/articles/open-source-java-profilers/ https://www.infoq.cn/article/yO6pjms5izsxK5YrZ036


(google search) (amazon search)


Thu May 04 12:27:29 GMT 2023 From /weblog/java/features

agent


http://www.takipioncode.com[..]1/07/double-agent-java-vs-native-agents/

List the pros of using native agent - http://apmblog.compuware.com[..]-for-application-performance-management/

Writing a Profiler in 240 Lines of Pure Java - https://mostlynerdless.de[..]ng-a-profiler-in-240-lines-of-pure-java/

(google search) (amazon search)


Fri Apr 21 23:07:50 GMT 2023 From /weblog/java/features

security


Introduction to Java Encryption/Decryption - https://dev.java/learn/security/intro/

Java Serialization Filtering: Prevent 0-day Security Vulnerabilities - https://foojay.io[..]g-prevent-0-day-security-vulnerabilities

Using JCE with OpenSSL - http://kasparov.skife.org[..]ive/src/java/jce-openssl-redux.writeback

---------- Forwarded message ----------
From: "cab"
To:
Date: 10 Mar 2005 23:33:16 +0800
Subject: Re: CRC-32

java.util.zip.CRC32 crc32 = new java.util.zip.CRC32();
crc32.update(byteArray);
long crcValue = crc32.getValue();

"Day Chan" 撰寫於郵件新聞:[email protected]...
> Does anyone know how to calculate CRC-32 in Java?
> Thanks~

(google search) (amazon search)


Thu Apr 20 13:08:46 GMT 2023 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

Discussion and comparison of difference GC at Java 1.7 - http://mechanical-sympathy.blogspot.com.au[..]7/java-garbage-collection-distilled.html . And here is the detail experiment among those difference GC, look like G1 is quite promising - http://java-is-the-new-c.blogspot.com.au[..]ng-and-benchmarking-java-7s-garbage.html

Memory is not allocate to single block, thus even you allocate enough memory in term of size, it may not enough to held individual object - https://plumbr.eu/blog/outofmemoryerror-on-overprovisioned-heap

Introduction to metaspace - http://www.infoq.com/articles/Java-PERMGEN-Removed

http://vanillajava.blogspot.com.au[..]optimising-memory-consumption-first.html

Some comments about System.gc() - http://jeremymanson.blogspot.com[..]om/2015/12/why-i-dont-like-systemgc.html

http://blog.takipi.com[..]ng-your-java-garbage-collection-overhead

Logging stop-the-world pauses in JVM - https://plumbr.eu[..]log/logging-stop-the-world-pauses-in-jvm

Why we should put difference app in same VM - http://mydailyjava.blogspot.hk[..]0/generational-disparity-in-garbage.html

Atlassian GC tuning guide - https://confluence.atlassian.com[..]ollection-gc-tuning-guide-461504616.html

Using jemalloc to get to the bottom of a memory leak - https://gdstechnology.blog.gov.uk[..]c-to-get-to-the-bottom-of-a-memory-leak/

Troubleshooting-Java-Memory-Issues - https://www.infoq.com/articles/Troubleshooting-Java-Memory-Issues

Useful parameters for OOME - https://jaxenter.com/jvm-outofmemoryerror-161257.html

Why Java's TLABs are so important and why write contention is a performance killer in multicore environments - https://www.opsian.com/blog/jvm-tlabs-important-multicore/

MMU gang wars: the TLB drive-by shootdown - http://bitcharmer.blogspot.com/2020/05/t_84.html

Latency implications of virtual memory - https://rigtorp.se/virtual-memory/

foreign-memaccess - http://cr.openjdk.java.net[..]cimadamore/panama/foreign-memaccess.html

Detect proactively whether application’s memory is under-allocated - https://jaxenter.com/memory-under-allocated-176329.html

Panama: Not-so-Foreign Memory. Using MemorySegment as a high-performance ByteBuffer replacement without a 2GB limit. - https://gavinray97.github.io/blog/panama-not-so-foreign-memory https://www.reddit.com[..]soforeign_memory_using_memorysegment_as/

What’s the deal with humongous objects in Java? - https://devblogs.microsoft.com[..]-the-deal-with-humongous-objects-in-java


Netflix on Java: How to build a 1TB Non-Heap, ultra-efficient application for video streaming - an example - https://dac.digital[..]on-heap-application-for-video-streaming/

(google search) (amazon search)


Sat Mar 18 12:52:17 GMT 2023 From /weblog/java/network

mqtt


一文带你掌握物联网 Mqtt 网关搭建背后的技术原理 - https://xie.infoq.cn/article/15d34a2d1042101d319261da8

(google search) (amazon search)


Wed Mar 08 12:44:43 GMT 2023 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

The beauty of the design of threadlocal, how it prevent locking and memory leaking - http://plumbr.eu/blog/how-is-threadlocal-implemented

JEP 429: Extent-Local Variables to Promote Immutability in Java - https://www.infoq.com/news/2022/09/extent-local-variables-java/

An Introduction to Scoped Values in Java - https://foojay.io/today/an-introduction-to-scoped-values-in-java/

(google search) (amazon search)


Wed Mar 08 12:38:40 GMT 2023 From /weblog/java/features

optional


The Beauty of Java Optional and Either - https://dzone.com/articles/the-beauty-of-java-optional-and-either


(google search) (amazon search)



Fri Feb 17 11:55:07 GMT 2023 From /weblog/java/features

type


Autoboxing, Type can be changed - http://blog.jooq.org/2013/10/08/java-auto-unboxing-gotcha-beware/

Project Valhalla: A look inside Java’s epic refactor - https://www.infoworld.com[..]a-a-look-inside-javas-epic-refactor.html

(google search) (amazon search)


Wed Feb 15 13:22:38 GMT 2023 From /weblog/java/tools

memory


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

Tool to check java memory layout, how the object placed in JVM - http://openjdk.java.net/projects/code-tools/jol/

Question: How do you handle oversized heap analysis? - https://www.reddit.com[..]w_do_you_handle_oversized_heap_analysis/

JVM Field Guide: Memory - https://serce.me/posts/01-02-2023-jvm-field-guide-memory

(google search) (amazon search)


Wed Feb 08 13:19:36 GMT 2023 From /weblog/java/features

java19


Structured Concurrency and Loom - https://www.loicmathieu.fr[..]ss/en/informatique/java-19-quoi-de-neuf/

Using Pattern Matching - https://dev.java/learn/pattern-matching

(google search) (amazon search)


Sat Dec 10 12:45:08 GMT 2022 From /weblog/java/features

vector


FizzBuzz – SIMD Style! - https://www.morling.dev/blog/fizzbuzz-simd-style/

SIMD accelerated sorting in Java - how it works and why it was 3x faster - https://jbaker.io/2022/06/09/vectors-in-java/

(google search) (amazon search)


Tue Aug 02 13:15:30 GMT 2022 From /weblog/java/libraries

pandas


Kotlin DataFrame Preview - https://blog.jetbrains.com[..]022/06/kotlin-dataframe-library-preview/

(google search) (amazon search)


Tue Aug 02 12:39:29 GMT 2022 From /weblog/java/fundamental

constructor


Things I didn't know about Java: Generic Constructors - https://www.objectos.com.br/blog/java-generic-constructors.html

(google search) (amazon search)


Wed Jul 06 13:31:29 GMT 2022 From /weblog/java/features

image


Strategies of loading image, select difference API to load image in difference case - http://java.sun.com[..]rticles/Media/imagestrategies/index.html

The Perils of Image.getScaledInstance() , with more detail explanation of image handling - http://today.java.net[..]3/perils-of-image-getscaledinstance.html

In Part I we talk about the building blocks of metadata in images and how it may matter to you as developer. - https://hillert.com/blog/read-write-image-metadata-java-part-1/

(google search) (amazon search)


Sun May 22 12:36:05 GMT 2022 From /weblog/java/fundamental

data


Data in Java programs - a basic conceptual model - https://docs.google.com[..]TscD4uW2Qsbt5BlBR_7uX_BekwJ5BLSE/preview

(google search) (amazon search)


Tue May 03 14:08:30 GMT 2022 From /weblog/java/hacks

classloading


Hint to prevent blocking of loadClass by using Thread.getContextClassLoader() - https://blog.fastthread.io[..]3/java-class-loading-performance-impact/

(google search) (amazon search)


Mon Apr 25 00:31:35 GMT 2022 From /weblog/java/performance

collection


Performance comparison for various implementation - http://java-performance.info[..]-sachs-hppc-koloboke-trove-january-2015/

Java Hashtable, HashMap, ConcurrentHashMap – Performance impact - https://blog.fastthread.io[..]ap-concurrenthashmap-performance-impact/

http://marxsoftware.blogspot.com/2015/12/discovering-trove.html

Using Red-Black tree in Map - https://dzone.com[..]shmaps-keys-and-the-comparable-interface

(google search) (amazon search)


Fri Apr 15 12:54:04 GMT 2022 From /weblog/java/network

scalability


1,000,000 Concurrent Connections - https://josephmate.github.io/2022-04-14-max-connections/

(google search) (amazon search)



Tue Mar 29 05:28:14 GMT 2022 From /weblog/java/fundamental

hash


JVM Anatomy Quark #26: Identity Hash Code - https://shipilev.net/jvm/anatomy-quarks/26-identity-hash-code

Hash, displace, and compress: Perfect hashing with Java - https://www.andreinc.net/2022/03/15/perfect-hashing-with-java

(google search) (amazon search)


Sat Mar 19 12:00:19 GMT 2022 From /weblog/java/concurrency

Interrupt


Just know that interrupt() call is just setting a flag, it have to be doing IO work (like database call), or in wait() status, before the thread can really be interrupted.

http://blogs.sun.com[..]winger?entry=swingworker_stop_that_train

Another nice explanation about interrupt, in summary:

What should we do when we call code that may cause an InterruptedException? Don't immediately yank out the batteries! Typically there are two answers to that question:
1) Rethrow the InterruptedException from your method. This is usually the easiest and best approach. It is used by the new java.util.concurrent.* package [ http://java.sun.com[..]util/concurrent/Semaphore.html#acquire() ], which explains why we are now constantly coming into contact with this exception.
2) Catch it, set interrupted status, return. If you are running in a loop that calls code which may cause the exception, you should set the status back to being interrupted. For example:
while (!Thread.currentThread().isInterrupted()) {
// do something
try {
TimeUnit.SECONDS.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}
}
Remember the Law of the Sabotaged Doorbell - don't just ignore interruptions, manage them properly!

- http://www.javaspecialists.eu/archive/Issue146.html

Another blog explain about InterruptedException - http://www.nurkiewicz.com[..]terruptedexception-and-interrupting.html

http://ocpsoft.org[..]running-infinite-java-regular-expression

http://praveer09.github.io[..]derstanding-thread-interruption-in-java/

How to Stop a Java Thread Without Using Thread.stop()? - https://4comprehension.com[..]a-java-thread-without-using-thread-stop/

(google search) (amazon search)


Sat Feb 12 14:08:30 GMT 2022 From /weblog/java/features

java8


Introduction of Lambdas expression in Java - http://zeroturnaround.com/labs/java-8-the-first-taste-of-lambdas/ , an example show how lambdas help to clean up the duplication - http://www.nurkiewicz.com[..]mplifying-readwritelock-with-java-8.html

Another article about Java8 change, where Lambdas is the highlight - http://www.infoq.com/news/2013/08/everything-about-java-8 http://www.shaunabram.com/java8/

Nice tutorial - http://www.dreamsyssoft.com/java-8-lambda-tutorial/index.php

Huge list of articles - http://www.baeldung.com/java8

Use lambdas to replace for-loop - http://saltnlight5.blogspot.com.au[..]creating-your-own-loop-structure-in.html https://www.ibm.com/developerworks/library/j-java8idioms3

Overview for new Date/Time library - http://www.infoq.com/articles/java.time https://binkley.blogspot.com[..]/02/java-date-time-timezone-formats.html

http://www.javacodegeeks.com[..]om/2014/05/java-8-features-tutorial.html

Grouping and partitioning with stream - http://fahdshariff.blogspot.com[..]/11/java-8-streams-api-grouping-and.html
In a nutshell, make sure to never override a default method in another interface - http://mydailyjava.blogspot.com.au[..]va-8-default-methods-can-break-your.html

Convert SQL feature to stream - http://blog.jooq.org[..]and-their-equivalents-in-java-8-streams/

Simple overview of steam operation - https://www.javaprogramto.com[..]va-8-stream-intermediate-operations.html https://mydeveloperplanet.com/2020/09/23/java-streams-by-example

Behind the scenes: How do lambda expressions really work in Java? - https://blogs.oracle.com[..]o-lambda-expressions-really-work-in-java

Useful & Unknown Java Features - https://piotrminkowski.com[..]2022/01/05/useful-unknown-java-features/ https://www.infoq.cn/article/tWHfLK4Kxphu3JDhlds5


(google search) (amazon search)