NetBeans - Profiler testing Docker image
This Docker based Profiler tester helps you setup remote machine with Java code running and waiting for NetBeans Profiler to attach.
. |-- LICENSE.md - MIT license file |-- README.md - this README.md file |-- Dockerfile - Docker file for creating image |-- run.sh - wrapper script that runs everything `-- images - sample images show here
Creating profiler server
Before you can proceed, you have to create profiler server inside NetBeans. I suggest to store it inside
Open remote profiler settings by choosing:
Profile -> Attach to External Process
> git clone https://github.com/mkowsiak/ProfilerDocker > cd ProfilerDocker > cp /tmp/profiler-server-linuxamd64.zip ./profiler-server-linuxamd64.zip > docker build -t profiler \ --build-arg jdk_location=\ "https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz" \ .
> docker run -i -t -p 5140:5140 profiler
if you can't use your local port
5140 you can always specify different port forwarding
> docker run -i -t -p $PORT_NO_YOU_WANT:5140 profiler
Attaching to running, remote, JVM
Make sure to
Attach from NetBeans and make sure to use
localhost as an address of the target machine.
At the moment, ProfilerDocker is using only one architecture for remote profiling:
Linux (Intel/AMD) 64bit JVM
Java code used for profiling
ProfilerDocker is based on very simple Java code that runs infinite loop. The loop spawns 2-4 threads, each sleeps 5-10 seconds and allocates memory in range: [512KB, 512MB].
You can find source code here: ProfilerCode.