Skip to content

Commit 35fe696

Browse files
committed
#1: Base image v0.1.0
1 parent 0a15523 commit 35fe696

12 files changed

+146
-21
lines changed

.0pdd.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
errors:
2+
3+
4+
tags:
5+
- pdd

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.index
2+
*.zip
3+
*.log
4+
/mat

.gitattributes

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto eol=lf
3+
4+
5+
# Add readily-visible signature (in SHA format) to all files (tagged by $Id$) with extension below.
6+
# Read more https://gist.github.com/treyharris/f98b708c9f5b753d60a2 .
7+
*.java ident
8+
*.yml ident
9+
*.xml ident
10+
11+
12+
# Explicitly declare text files we want to always be normalized and converted
13+
# to native line endings on checkout.
14+
*.txt text
15+
*.java text
16+
*.groovy text
17+
*.xml text
18+
*.md text
19+
*.pom text
20+
*.properties text
21+
*.tex text
22+
*.vm text
23+
*.xsl text
24+
*.yml text
25+
26+
27+
# Denote all files that are truly binary and should not be modified.
28+
*.png binary
29+
*.jpg binary

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/workspace
2+
*.log
3+
*.index
4+
*.zip
5+
*.threads
6+
/mat

.pdd

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--source=.
2+
--verbose
3+
--exclude target/**/*
4+
--exclude docs

Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM openjdk:8-jdk
2+
3+
LABEL contact="[email protected]" \
4+
sources="https://github.com/dgroup/mat" \
5+
dockerfile="https://github.com/dgroup/mat/blob/master/Dockerfile"
6+
7+
ENV MAT_HOME=/mat \
8+
MAT_DIST=MemoryAnalyzer-1.8.1.20180910-linux.gtk.x86_64.zip
9+
10+
RUN wget https://mirrors.dotsrc.org/eclipse//mat/1.8.1/rcp/${MAT_DIST} \
11+
&& unzip MemoryAnalyzer-1.8.1.20180910-linux.gtk.x86_64.zip \
12+
&& apt-get update \
13+
&& apt-get install --reinstall coreutils \
14+
&& apt-get -y install tree vim dos2unix git subversion \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ${MAT_DIST}
17+
18+
MAINTAINER 'Yurii Dubinka ([email protected])'

LICENSE

-21
This file was deleted.

MemoryAnalyzer.ini

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-startup
2+
plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar
3+
--launcher.library
4+
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.700.v20180518-1200
5+
-vmargs
6+
-Xmx4096m

docker-compose.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '2.3'
2+
3+
services:
4+
openjdk8-with-mat:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
image: dgroup/mat:0.1.0
9+
container_name: dgroup-mat

download-mat.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
MAT_DIST=MemoryAnalyzer-1.8.1.20180910-linux.gtk.x86_64.zip
4+
TARGET_FOLDER=mat
5+
wget https://mirrors.dotsrc.org/eclipse//mat/1.8.1/rcp/${MAT_DIST}
6+
rm -rf ${TARGET_FOLDER}
7+
unzip -o ${MAT_DIST}
8+
echo "-XX:+UseConcMarkSweepGC" >> mat/MemoryAnalyzer.ini
9+
echo "-XX:+UseParNewGC" >> mat/MemoryAnalyzer.ini
10+
echo "-XX:+CMSParallelRemarkEnabled" >> mat/MemoryAnalyzer.ini
11+
echo "-XX:+CMSClassUnloadingEnabled" >> mat/MemoryAnalyzer.ini
12+
echo "-XX:+UseCMSInitiatingOccupancyOnly" >> mat/MemoryAnalyzer.ini

license.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Yurii Dubinka
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"),
7+
to deal in the Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom
10+
the Software is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
21+
OR OTHER DEALINGS IN THE SOFTWARE.

readme.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
**Description**
2+
3+
[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)
4+
[![Commit activity](https://img.shields.io/github/commit-activity/y/dgroup/mat.svg?style=flat-square)](https://github.com/dgroup/mbox4j/graphs/commit-activity)
5+
[![0pdd](http://www.0pdd.com/svg?name=dgroup/mat)](http://www.0pdd.com/p?name=dgroup/mat)
6+
7+
Base docker image with OpenJDK 8 and MAT: `dgroup/openjdk8-mat`
8+
By default the MAT `v1.8.1.20180910` is used.
9+
10+
**Run the MAT in order to parse the heap dump**
11+
```bash
12+
docker run -it --rm -v "$PWD":/dumps -w /dumps \
13+
dgroup/mat /mat/ParseHeapDump.sh \
14+
java_pid8.hprof \
15+
org.eclipse.mat.api:suspects \
16+
org.eclipse.mat.api:overview \
17+
org.eclipse.mat.api:top_components
18+
```
19+
20+
**Run the MAT and override the default `MemoryAnalyzer.ini` settings"**
21+
1. Define your own `MemoryAnalyzer.ini`
22+
2. Pass custom settings to the docker container
23+
```bash
24+
docker run -it --rm -v "$PWD":/dumps \
25+
-v "$PWD/MemoryAnalyzer.ini":/mat/MemoryAnalyzer.ini \
26+
-w /dumps -m 5g \
27+
dgroup/mat /mat/ParseHeapDump.sh \
28+
java_pid8.hprof \
29+
org.eclipse.mat.api:suspects \
30+
org.eclipse.mat.api:overview \
31+
org.eclipse.mat.api:top_components
32+
```

0 commit comments

Comments
 (0)