Home » Author Archives: Dustin Marx (page 2)

Author Archives: Dustin Marx

Programmatic jcmd Access

java-logo

Questions posed online demonstrate the occasional desire of developers to access via their Java applications the types of information normally gained from running JConsole, VisualVM, or JDK command-line tools externally against the application. Here are some examples of those types of questions: How to get jmap histogram programmatically? Programmatically dumping heap from Java applications find which type of garbage collector ...

Read More »

Determining the Active HotSpot Garbage Collector

java-logo

The StackOverflow questions find which type of garbage collector is running, Default Garbage collector for a jvm, How can I see what garbage collector is running by looking at gc logs?, and How to know the current GC strategy of the HotSpot jvm?, and the blog post How to programmatically obtain GC information demonstrate the desire at times to know ...

Read More »

Java 8 Deferred Invocation with Java Util Logging

java-logo

In the blog post Better Performing Non-Logging Logger Calls in Log4j2, I looked at approaches one can use in Log4j 2 to reduce or avoid invocation of methods in log statements that, based on the specified log level, are not actually logged at all. As part of this discussion, I covered Log4j 2‘s support for Java 8-based deferred execution using ...

Read More »

Looking at DiagnosticCommandMBean in JConsole and VisualVM

java-logo

I’ve used JConsole for many years as a suitable generic JMX client. This tool is generally available with the Oracle JDK and is easy to use. In terms of JMX interaction, the most significant advantage of JConsole over VisualVM is that JConsole comes with a built-in MBeans tab while a plugin must be applied for this same functionality in VisualVM. ...

Read More »

SQL: Counting Groups of Rows Sharing Common Column Values

software-development-2-logo

In this post, I focus on using simple SQL SELECT statements to count the number of rows in a table meeting a particular condition with the results grouped by a certain column of the table. These are all basic SQL concepts, but mixing them allows for different and useful representations of data stored in a relational database. The specific aspects ...

Read More »

jcmd: One JDK Command-Line Tool to Rule Them All

java-logo

I have referenced the handy JDK tool jcmd in several posts in the past, but focus exclusively on its usefulness here like I have previously done for jps. The jcmd tool was introduced with Oracle’s Java 7 and is particularly useful in troubleshooting issues with JVM applications by using it to identify Java processes’ IDs (akin to jps), acquiring heap ...

Read More »

Default HotSpot Maximum Direct Memory Size

java-logo

In my previous blog post Improved Documentation of HotSpot Options in Java 8, I wrote about the misunderstandings surrounding the HotSpot JVM‘s default setting for non-standard option -XX:MaxDirectMemorySize. In this post, I look at a simple way to determine the “default” maximum direct memory size in the HotSpot JVM. The Java 8 documentation for the Java launcher states the following ...

Read More »

Simplicity and Value of HotSpot’s -XshowSettings Flag

java-logo

A handy HotSpot JVM flag (option for the Java launcher java) is the -XshowSettings option. This option is described in the Oracle Java launcher description page as follows:                 -XshowSettings:category Shows settings and continues. Possible category arguments for this option include the following: all Shows all categories of settings. This is the default ...

Read More »

Improved Documentation of HotSpot Options in Java 8

java-logo

One of the small but welcome features introduced with Oracle’s HotSpot implementation of Java 8 is the addition of many common HotSpot Java launcher (java) options/flags to the launcher’s documentation. In the past, a developer interested in even some fairly common HotSpot JVM options has had to potentially look in multiple different sources to find “official” documentation on these flags. ...

Read More »

Leaner Java Collections with FastUtil

java-logo

In response to my recent post Discovering a Trove of Java Primitives Collection Handling on the GNU Trove library, TheAlchemist pointed out some advantages of fastutil over trove: “I much prefer fastutil (http://fastutil.di.unimi.it/), because it’s still in active development, has more features, supports large sizes (> 2^32), and has better documentation.” Attila-Mihaly Balazs has seconded this: “I second @TheAlchemist’s recommendation ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials