機能 #19
完了アナログ時計をJavaFXで作成する
100%
ファイル
github_setup-1.png (4.11 KB) github_setup-1.png | 高橋 徹, 2014/08/30 13:23 | ||
taskmanager-1.png (99.6 KB) taskmanager-1.png | タスクマネージャの詳細、javaw.exeのCPU、メモリ使用状況 | 高橋 徹, 2015/10/20 08:50 | |
taskmanager-2.png (44.4 KB) taskmanager-2.png | タスクマネージャのパフォーマンス(CPU) | 高橋 徹, 2015/10/20 08:50 | |
taskmanger-3.png (40.2 KB) taskmanger-3.png | タスクマネージャのパフォーマンス(メモリ) | 高橋 徹, 2015/10/20 08:50 | |
jconsole_vm.png (44.4 KB) jconsole_vm.png | JConsoleのVM情報 | 高橋 徹, 2015/10/20 08:50 | |
jconsole-2.png (58.1 KB) jconsole-2.png | 高橋 徹, 2015/10/20 09:18 | ||
hotspot_client-1.png (53.3 KB) hotspot_client-1.png | 32bit JavaVM | 高橋 徹, 2015/10/23 03:40 | |
hotspot_client-2.png (60.5 KB) hotspot_client-2.png | 32bit JavaVM -Xmx16m | 高橋 徹, 2015/10/23 03:40 | |
heap_Xmx16m-2.png (60.5 KB) heap_Xmx16m-2.png | JConsole ヒープメモリ -Xmx16m指定時 16時間 | 高橋 徹, 2015/10/24 08:57 | |
heap_default-2.png (54.7 KB) heap_default-2.png | JConsole ヒープメモリ 16時間 | 高橋 徹, 2015/10/24 08:57 | |
cycle1_xmx24m_heap-1.png (54.1 KB) cycle1_xmx24m_heap-1.png | cycleCountを1にしてRotateTransitionを作り直してplayする版、32bit JVMで-Xmx24mで実行 | 高橋 徹, 2015/10/28 23:23 | |
cycle1_xmx24m_heap-2.png (45.8 KB) cycle1_xmx24m_heap-2.png | cycleCountを1にしてRotateTransitionを作り直してplayする版、32bit JVMで-Xmx24mで実行(old領域) | 高橋 徹, 2015/10/28 23:23 | |
cycle1_reuseRotateTransition_24m-1.png (55 KB) cycle1_reuseRotateTransition_24m-1.png | 高橋 徹, 2015/10/29 23:45 | ||
cycle1_reuseRotateTransition_24m-2.png (46.1 KB) cycle1_reuseRotateTransition_24m-2.png | 高橋 徹, 2015/10/29 23:45 | ||
cycle1_reuseRotateTransition_24m-3.png (60.2 KB) cycle1_reuseRotateTransition_24m-3.png | 高橋 徹, 2015/10/30 20:17 | ||
cycle1_reuseRotateTransition_24m-4.png (47.6 KB) cycle1_reuseRotateTransition_24m-4.png | 高橋 徹, 2015/10/30 20:17 |
高橋 徹 さんが10年以上前に更新
- ファイル github_setup-1.png github_setup-1.png を追加
GitHubにリポジトリを設けることとします。
- GitHubにログインして、右上のリポジトリ作成ボタンを押し、[New Repository]を選択
- リポジトリ名をanalogclockとして作成、ライセンスはMITとした
https://github.com/torutk/analogclock
- Redmineの本プロジェクトのリポジトリ設定に、上述のGitHubリポジトリを追加
Redmineにプラグインを入れるを参照
まず、GitHubのミラーリポジトリを作成~$ cd /var/lib/git_mirror git_mirror$ git clone --mirror git://github.com/torutk/analogclock.git Cloning into bare repository 'analogclock.git'... remote: Counting objects: 5, done. remote: Compressing objects: 100% (5/5), done. remote: Total 5 (delta 0), reused 0 (delta 0) Receiving objects: 100% (5/5), git_mirror$
- Redmineのプロジェクト設定でリポジトリを追加
リポジトリ識別子:github_analogclock
リポジトリの場所:/var/lib/git_mirror/analogclock.git - GitHubのリポジトリに更新通知設定
GitHubのanalogclockリポジトリを開き、[Settings] > 左側メニューの"Webhooks & Services"をクリックし[Add webhook]ボタンをクリック
Payload URLにhttp://www.torutk.com/github_hook?project_id=swd&repository_id=github_analogclock
Content typeはデフォルトのまま(application/json)としています。
イベントの種類はデフォルトのまま(Just the push event)としています。
高橋 徹 さんが10年以上前に更新
GitHubを更新してもRedmineのリポジトリが更新されない問題発生。
GitHubのWebhookページを見ると、Recent Deliberliesがエラーになっている(404)。
うまくいっているjarmanifestviewerと設定の違いを見まくると、URLのオプションパラメータの誤記が発見
- http://www.torutk.com/github_hook?project_id=swd&repository_id=github_analogclock
+ http://www.torutk.com/github_hook?project_id=swe&repository_id=github_analogclock
修正したらOK
なお、Redmine稼動マシン上のgitミラーディレクトリを手動で更新するときは、git pull
ではなくgit fetch
です。
作業ディレクトリは展開していないので、pullでは駄目です。
高橋 徹 さんが10年以上前に更新
SVG版に着手しました。
JavaFXには、SVGPathというシェープがあるので、これを使うのかと思われます。
まず、SVGについて理解をするために、SVGの勉強情報を探しました。
http://tutorial.jp/graph/
このサイトで公開されている「SVG実習マニュアル」が良かったです。
SVGには、rect、line、circle、ellipse、polygonなどの図形定義要素、linearGradient、radialGradientなどのグラデーションがありますが、JavaFXのSVGで使えるのはパスだけのようです。
時計盤を記述するため、パスで円を描こうと調べました。まず楕円弧を描くコマンドAがあるので、これを使ってみます。
SceneBuilderでSVGPathを貼って、そのプロパティContentにパス定義を記述します。
高橋 徹 さんが9年以上前に更新
- ファイル taskmanager-1.png taskmanager-1.png を追加
- ファイル taskmanager-2.png taskmanager-2.png を追加
- ファイル taskmanger-3.png taskmanger-3.png を追加
- ファイル jconsole_vm.png jconsole_vm.png を追加
CPU、メモリの使用率を調査(SVG版)
PCは 購入PC-KIRA-L93
Windows 10 64bit版、JDK 8u60 64bit版で実行(VMオプションなし)
24個立ち上げた時の状況
各プロセスのCPU・メモリ使用状況
マシン全体のCPU使用率
マシン全体のメモリ使用状況
JConsoleで1個に接続してVMサマリーを表示
高橋 徹 さんが9年以上前に更新
- ファイル hotspot_client-1.png hotspot_client-1.png を追加
- ファイル hotspot_client-2.png hotspot_client-2.png を追加
32bit版Oracle JDK 8u66(クライアントコンパイラ)で実行したときのヒープメモリ推移
デフォルトで実行
最大ヒープサイズを16MB(-Xmx16m)で実行した場合
なんともメモリリークな兆候を示しています。
JavaFXのAPIドキュメント(Timeline)には、
http://docs.oracle.com/javase/jp/8/javafx/api/javafx/animation/Timeline.html
警告: 実行中のTimelineはFXランタイムから参照されます。Timelineを無限にした場合、適切に停止しないと、メモリー・リークが発生する可能性があります。アニメーション化されるプロパティを持つすべてのオブジェクトがガベージ・コレクションの対象となるわけではありません。
とあるので、あれま、ぴったりこの状況に該当しています。
高橋 徹 さんが9年以上前に更新
- ファイル heap_Xmx16m-2.png heap_Xmx16m-2.png を追加
- ファイル heap_default-2.png heap_default-2.png を追加