Java, SQL and jOOQ. Best Practices and Lessons Learned from Writing Awesome Java and SQL Code. Get some hands-on insight on what's behind developing jOOQ.
以前、このような記事を書きました。 Concurrency Utilitiesを使った並列処理・マルチスレッドのおさらい (2013-12-26) 前回の内容は、Concurrency UtilitiesだけでなくJavaのマルチスレッドの話も一部含んでいましたが、今回は、Concurrency Utilitiesだけにフォーカスして、全体が分かるように整理してまとめ直しました。 目次 概要 準備 タスク・フレームワーク (Executor) 同期キュー シンクロナイザー 並行処理コレクション 時間単位 アトミック値型とアトミック操作 ロック・フレームワーク 概要 今回は、Concurrency UtilitiesのAPIをいくつかのグループに分類し、それぞれのグループの主要な機能を「広く浅く」紹介する、という形式でまとめています。 パッケージ単位で分け、それからjava.util.con
この記事は、個人的なおさらいのための、Java Concurrency Utilitiesの一部を使ったサンプルとメモです。 目新しいものは特にありません。 記事内のサンプルとAPIドキュメント参照はJava7(Java SE 7)を基準にしていますが、Java Concurrency Utilities自体は一部を除いてJava5(Java SE 5.0)から使えるようになっています。 あと、いつものことですが、画像がありません。 追記(2014-01-05): この機能の呼称は (Java) Concurrency Utilities が公式で、この記事内の"Utility"というのは正確ではない+混在していますのでご注意ください。ごめんなさい。 追記(2014-08-15): この記事は、キーワード"Java Concurrency Utilities"でGoogle検索した時に2番
システムスレッドについて、あまり知らなかったので、調べてみました。 それ以外にも、APIで生成されるスレッドや、スレッドグループについても、少し触れています。 ※GrepCodeは2018年5月頃からサービスが利用できなくなっています。記事中のリンクはGrepCodeのものがそこそこ多いので、ご注意ください。 参考リンク HotSpot Runtime Overview - OpenJDK JVM Internals (JamesDBloom - Blog) Java SE 8 API仕様 GC: openjdk-8-b132.jar - GrepCode Java Project Source Mirror of OpenJDK repositories - GitHub 目次 はじめに 実行環境 システムスレッドの名称と簡単な説明 APIを使用したときのスレッド おわりに はじめに シ
第八回 #渋谷java で発表した「あなたとスレッドダンプ」です。 スレッドダンプの使いみち、取り方、読み方について説明しています。 スレッドダンプこわくない。
スレッドダンプの取り方は前に説明した通りです。 #二年近く前ですが・・・ しかし、スレッドダンプは取得しただけでは役に立ちません。 もちろん、スレッドダンプは解析して初めてトラブルシューティングやチューニングに役立つものです。 そこで、今回からは具体的にスレッドダンプの中身を見ていきましょう。 説明に使うアプリケーションはこんな感じ。起動したら "Hello World! と表示して10秒間スリープするという簡単なもの。 public class ThreadTest1{ public static void main(String args[]) throws Exception { System.out.println("Hello World!"); method1(); } private static void method1() throws Exception { Threa
The document discusses various aspects of concurrency in Java such as synchronized blocks, volatile variables, and reordering issues. It provides examples of how to properly synchronize access to shared mutable data using locks and compares the behavior of synchronized and volatile. The final sections cover atomicity in Java and how the volatile keyword prevents instruction reordering problems but
Comsat transparent concurrency for maximal http service scalability Comsat is a set of open source libraries that integrate Quasar with various Web or enterprise technologies (like HTTP services and database access). With Comsat, you can write web applications that are scalable and performant while, at the same time, are simple to code and maintain. You will enjoy the scalability of asynchronous s
Understanding how Core Java really works can help you write simpler, faster applications. OverviewJava has many areas which can be slow. However for every problem there is a solution. Many solutions/hacks require working around Java's protections but if you need low level performance it is still possible. Java makes high level programming simpler and easier at the cost of making low level programm
下記の「旧FC2無料ホームページスペース」は2025年06月30日をもちましてサービスを終了いたしました。 FC2WEB http://www.fc2web.com GOOSIDE http://www.gooside.com k-free.net http://www.k-free.net Easter http://www.easter.ne.jp 55 STREET http://www.55street.net ZERO_CITY.com http://www.zero-city.com OJIJI.NET http://www.ojiji.net K-Server http://www.k-server.org Zero-yen.com http://www.zero-yen.com KTNET http://www.kt.fc2.com Finito http://www.fi
Tomcatもビジーになってくると、スレッドが効率的に利用されているのかが気になってくる。それにはスレッド状態を見てやればよい。 Linux kernel 2.6.Xでは、procfsを覗いてやると、各プロセス中のスレッド状態を取得することが出来る。Tomcatのスレッド状態をコマンド一発で取得できればうれしいね。ということでシェルスクリプトを作ってみた。 #! /bin/sh # # tomcatstat.sh : Obtain thread statuses of Tomcat # # Copyright(c) 2012 Ryuichi Kurishima # # This script is BSD licensed. # CNT_R=0 CNT_S=0 CNT_D=0 CNT_Z=0 CNT_T=0 CNT_W=0 CNT_ALL=0 CNT_UNKO
Tomcatの最大使用可能スレッド数の見積 にて述べたとおり、Javaバージョンによって、Tomcat/javaが使用することが出来る(最大)スタックサイズが決まっている。しかし、スタックサイズ分だけ仮想メモリがいきなり全部割り当てられるわけでなく、実際はより小さな値が割り当てられていることが多い。スタックサイズを気にせずにスレッド数を決めても、多くの場合は逼迫した状態にはならないものだ。 では実際のところ、Tomcat/Javaはどの程度のスタックを割り当てて稼動しているのであろうか。 一つの例として、以下のようなTomcatを見てみる。 root@server# ps -ef|grep java tomcat 7559 1 0 Mar17 ? 00:07:38 /usr/local/java/bin/java -Djava.util.logging.ma
Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003/10/10 Copyright NTT COMWARE 2003 Linux Kernel Conference 2003
If you have ever written a production multi-threaded server in Java, you know how difficult it is to implement load balancing between worker threads. You need to fight many issues to have a good load balancer: You need to limit the number of worker threads somehow, as an unlimited thread pool can exhaust memory. You need to implement a sophisticated procedure for a clean worker shutdown. If you ar
Apacheのアクセスログ(commonあるいはcombined形式)をLTSVに変換するツールをJavaで書いてみた。 使い方: mcp.jarをダウンロードし、 cat access_log | java -cp mcp.jar net.jumperz.app.MCP.MCP net.jumperz.io.multicore.example.MCombined2LTSV パースするコードそのものはこんな感じで普通。正規表現は使っていない。たぶんJava1.4以上でコンパイル可能。 こういう処理をさくっとマルチコア対応にするためのフレームワーク、MCPというのを作ったので、早速利用してみると、手元の4コアのマシンでは約140万行/秒(common形式のログ)という爆速で変換が終了する。dankogai氏が書かれているperlスクリプトより約20〜30倍速い(正規表現を使うかどうかという点
Everything I Ever Learned About JVM Performance Tuning @TwitterAI-enhanced description The document outlines JVM performance tuning strategies, with a focus on reducing latency caused primarily by garbage collection. It covers various areas of optimization including memory footprint, lock contention, CPU usage, and I/O tuning, while highlighting the drawbacks of heavy frameworks like Thrift. Key s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く