12 September 2019

Eclipse MAT Classloaders

Network Troubleshooting

Summary of networking tools for troubleshooting.

  1. https://developer.ibm.com/articles/au-aixnetworkproblem1/
  2. https://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/

responsive ping

$ ping testhost
PING testhost: ( 56 data bytes
64 bytes from icmp_seq=0 ttl=253 time=0 ms
64 bytes from icmp_seq=1 ttl=253 time=0 ms
64 bytes from icmp_seq=2 ttl=253 time=0 ms

ping unresponsive:

$ ping testhost
PING testhost.testdomain.com: ( 56 data bytes

‑‑‑‑testhost.testdomain.com PING Statistics‑‑‑‑
5 packets transmitted, 0 packets received, 100% packet loss

Displaying network adapter status

$ ifconfig en1
        inet netmask 0xffffff00 broadcast
         tcp_sendspace 131072 tcp_recvspace 65536

$ifconfig ‑a
en2: flags=7e080863,40
        inet netmask 0xffffff80 broadcast
en1: flags=7e080863,40
        inet netmask 0xffffff00 broadcast 10.216.163.

Displaying Ethernet statistics for a network adapter
$ entstat ‑d en2
Device Type: 10/100/1000 Base‑TX PCI‑X Adapter (14106902)
Hardware Address: 00:02:55:d3:37:be
Elapsed Time: 114 days 22 hours 48 minutes 20 seconds

Transmit Statistics:           Receive Statistics:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑           ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
Packets: 490645639             Packets: 3225432063
Bytes: 9251643184881           Bytes: 215598601362
Interrupts: 0                  Interrupts: 3144149248

Tracing a successful route to a host   

$ traceroute testhost
trying to get source for testhost
source should be
traceroute to testhost ( from (, 30 hops max
outgoing MTU = 1500
 1 (  1 ms  0 ms  0 ms
 2 (  0 ms  0 ms  0 ms
 3  testhost (  1 ms  1 ms  1 ms

traceroute -p 40015

Testing port 80 (HTTP) on a host (successful)

$ telnet testhost 80
Connected to testhost.
Escape character is '^]'.
telnet> quit
Connection closed.

$ grep testhost /etc/hosts    testhost testhost.testdomain.com aixserver

Resolving a host name via DNS

$ nslookup testhost
Server:  testdns.testdomain.com

Name:    testhost.testdomain.com

Get DNS Records Using dig and host Commands

You can use the dig command to verify DNS mappings, host addresses, MX records, and all other DNS records for a better understanding of DNS topography.

The dig command was developed to replace nslookup command.

$ dig google.com

Telnet without telnet:

curl -v telnet://

cat < /dev/tcp/

telnet: ctrl+] is an escape sequence that puts telnet into command mode,

curls cookies

curl -c - ""

curl -c - ""

curl -v --cookie 'JSESSIONIDMULTIPRO=123' -c - ""


mtr >> ping/traceroute
curl >> wget
htop >> ps/top
ncdu >> du
parallel >> xargs/ssh
rsync >> cp/scp
ag >> find/grep

SSL test:



netstat -apn (linux)


how to know IP :

ifconfig | grep "inet " | grep -v

ifconfig eth0

netstat cheat sheet

Difference among JVM JRE JDK

JVM = responsible for executing the java program line by line hence it is also known as an interpreter.

JRE = JVM + Lib classes

JDK = JRE + Dev Tool

10 September 2019

Visitor Pattern

Two simple examples are taken from github repo about Visitor pattern:

The Visitor drops by:

  • The Visitor must visit each element of the Composite; that functionality is in a Traverser object.
  • The Visitor is guided by the Traverser to gather state from all of the objects in the Composite.
  • Once the state has been gathered, the Client can have the Visitor perform various operations on the state.
  • When new functionality is required, only the Visitor must be enhanced.

From: Head First Design Patterns.

1. https://github.com/devwebcl/simple_design_patterns/tree/master/visitor-pattern/src/main/java/com/iluwatar/visitor

2.  https://github.com/devwebcl/simple_design_patterns/tree/master/visitor-pattern/src/main/java/com/behavioural/visitor


  1. https://github.com/chirey/designPatternsThoughtsCode
  2. https://github.com/iluwatar/java-design-patterns/tree/master/visitor

Java Threads API Evolution

After searching again for this cool article: https://howtodoinjava.com/java/multi-threading/java-multi-threading-evolution-and-topics/

Here there is a summary of Threads evolution through the years:

JDK 1.0


JDK 1.1

The Thread.stop, Thread.suspend, and Thread.resume methods are deprecated as of JDK 1.1.

JDK 1.2 and JDK 1.3 

had no noticeable changes

JDK 1.4

There were few JVM level changes to suspend/resume multiple threads with single call.

JDK 1.5 

was first big release after JDK 1.x; and it had included multiple concurrency utilities. Executor/ExecutorService, semaphore, mutex, barrier, latches, concurrent collections and blocking queues;

JDK 1.6

was more of platform fixes than API upgrades.

JDK 1.7 

added support for ForkJoinPool which implemented a work-stealing technique to maximize the throughput. Also, Phaser class was added.

JDK 1.8 

is largely known for Lambda changes, but it also had few concurrency changes as well. Two new interfaces and four new classes were added in java.util.concurrent package e.g. CompletableFuture and CompletionException.

The Collections Framework has undergone a major revision in Java 8 to add aggregate operations based on the newly added streams facility and lambda expressions; resulting in a large number of methods added in almost all Collection classes, and thus in concurrent collections as well.


JEP 266: More Concurrency Updates defines an interoperable publish-subscribe framework for reactive streams, enhancements to the java.util.concurrent.CompletableFuture class, and various other improvements.

My Blog List

Blog Archive


The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.