≡ Menu

JVM – Basic Operations

A Java application is launched with the java command which starts a JVM and runs the application. As an Application support engineer, there are few basic operations that you will typically perform on the JVM. Here are they:

Starting JVM:

Starting the JVM simply means starting the Java application. A Java application is started using the java command.

For example:

java HelloWorld 

java is the command

HelloWorld is the classfile without the .class extension

Note: Don’t use the .class extension in the java command. If you do, you will get an error

[ec2-user@java]$ java HelloWorld.class
 
Error: Could not find or load main class HelloWorld.class

There are numerous command line options for the java command. Here are some of the main ones you need to know.

Read More

JVM: Basic Framework

As an Application Support Engineer, you will invariably end up managing Java based applications. JVM (Java Virtual Machine) is the all-important process that runs the Java Application you are going to manage (which can be either custom developed by your development group, or a commercial off the shelf product). It is imperative that you have a very good understanding of how JVM works.

Note: Some of the material in this section will be very basic that experienced Administrators can choose to skip.

At a high level:

  1. Java is a high level programming language (this is the code). A java program is a text file(s) that is/are human readable.
  2. Javac is a compiler program that compiles the human readable java code in to machine readable byte code.
  3. JVM (Java virtual machine) is a process that runs the java byte code. It is an implementation of specification created by Sun/Oracle.

Read More

What is Virtualization?

Virtualization is a technique using which you can run multiple Operating Systems (aka Guest) in a physical server (host) by abstracting (or virtualizing) CPU, Memory, Disk and Network resources. The core component of any virtualization solution is Hypervisor – the software that performs the abstraction of bare metal resources.

Here are the primary benefits of using Virtualization:

  1. Save cost on hardware
  2. Centrally manage the infrastructure
  3. Add effective fault tolerance and high availability
  4. Dynamically update the infrastructure

The diagram below shows virtualization at a high level.

Read More

5 reasons why you can’t afford NOT to Virtualize

The verdict is in. Virtualization is the future. If you are still running your applications on bare metal, you are missing out on tons of benefits, or even hurting your business. Virtualization is a software tech that lets you run multiple operating systems and applications on a physical server by abstracting the hardware underneath. Among several Virtualization software makers, the following are considered leaders:

VMWare (ESXi)

Citrix (XenServer)

Microsoft (Hyper-V)

Let’s dive in to 5 reasons why you can’t afford NOT to virtualize (not necessarily in any order)

Read More

How to use AppDynamics to monitor Server health?

Yes, AppDynamics is awesome for Application monitoring – Java Heap, deep transaction tracing, tons of out-of-the-box framework monitoring (JDBC,WebService etc) and the list goes on. But do you know Appdynamics can be used to effectively monitor Servers too, whether it is virtual or physical? When I say server, I mean the host operating system such as RedHat Enterprise Linux, Windows 2012, Solaris etc. Let me show you how you can do this.

Enter AppDynamics Machine Agent

While Java can be monitored using a Java Agent, a Server can be monitored using a special type of agent called Machine Agent. You will have to have license to run these agents (When you purchase Application agents, typically AppDyanmics throws the same number of Machine Agents, and so you should be good in terms of additional cost). If you are not sure about your present licensing situation, click on ‘licensing’ in your Controller UI as shown below.

Unlike Application agents which run inside the JVM/CLR, Machine agent is a standalone Java program that runs on the host operating system. It collects hardware metrics and sends them to Controller (once a minute). A user can view these metrics via Controller UI. Pretty simple, hah?

Read More

Java Heap is a labyrinth. You can spend hours or even days analyzing a heap dump from a production Java application. Heap is where all the objects created by your application live. And even in a relatively simple application, there could be hundreds of thousands of objects created. When dealing with Java memory leak, you know you are looking for one the following (or both):

  1. Excessive number of objects of certain class
  2. Objects with unusually large size

Fortunately, Appdynamics provides a feature using which you can easily reveal both of the above cases. Let’s get right to it.

  • In AppDynamics Controller UI, locate the Node that you want to troubleshoot and click on ‘Memory’ tab

Read More

In this part, let’s explore AppDynamics facilities for diagnosing Memory Leaks. AppDynamics provides two powerful tools to hunt down memory leaks.

  1. Automatic Leak Detection
  2. Objet Instance Tracking

Automatic Leak Detection

With Automatic Leak Detection enabled, Appdyanmics can capture objects that live longer than usual period – i.e long lived Collection objects that simply won’t get garbage collected. If your application is leaking memory, it is definitely one of these long-living, never-dying objects that cause the leak. Use the following procedure to make use of this tool.

Read More

Troubleshooting JVM memory issues can be daunting, but you if you don’t fix it, it can kill your application and possibly your face in front of your customers. There is good news though. With any modern APM tool, you virtually get an X-Ray vision to this labyrinth named Java Heap.

In this blog post, I’ll show you how to use AppDynamics to troubleshoot Java memory issues.

AppDynamics is one of the leading APM vendors in the market, providing tons of useful tools ranging from Hardware monitoring to End user experience monitoring to operational data analytics (Actually it can be quite overwhelming. If you don’t know what exactly you are looking for in the tool, you can go in circles. But don’t worry, I can help).

There are three major areas where AppDynamics can help in regards to Java memory troubleshooting.

Read More

How to install Apache Web Server using Yum?

Software installation has never been more fulfilling since YUM came along.

YUM is the most popular rpm based interactive package manager. It is super powerful and reliable.

In this quick article, I show how to install apache web server, the world’s most popular web server in your Linux Server.

You need to have root access to do this. You also need to have internet access on the server you are installing apache.

Simply run the command

sudo yum install httpd

That’s it. Yum does the rest.

Once done, which takes about 10 seconds, start the httpd server

Sudo service httpd start

Once the service starts, simply use a browser to access the server (use the default server name or the ip address).

Or you can choose the geeky way to use curl to test out. I created a basic html file. Here is how to access it

Curl http://localhost/index.html

You can check access.log to see how you did. Access_log is present under /var/log/httpd/

The configuration file for apache (httpd.conf) will be under /etc/httpd. (This depends on your platform).

That’s it. Your own enterprise grade Web Server, up and running in about 10 seconds.

Way to go YUM !!