1

We are a software shop that writes a lot of Java code. Most of our Java app servers are CentOS boxes hosted at a remote data center.

Whenever we need to get into those machines and sift around we use PuTTY.

I was recently asked to monitor our JVM using the jvisualvm memory profiler, which is a rich GUI tool that uses lots of graphs and charts with pretty colors. When I asked my tech lead how I could view such a GUI tool over a character-based command tool like PuTTY, he told me to use something called Reflection X instead.

This prompted me to read up on Reflection X and X Windows in general (which I have never had any exposure to).

I now understand that "X" is a hardware abstraction layer so that you can write GUI-oriented code and have it deployed on any hardware that X can run on. In this way it is identical (in theme) to the Java virtual machine.

What I am not understanding is the relationship between my Windows PC, Reflection X, the CentOS machine running the app I have to profile, and the jvisualvm tool itself: who is doing what?

Does Reflection X run on my machine, or is it installed on the linux server? What is it about Reflection X that will allow me to view jvisualvm remotely?

Thanks in advance!

3 Answers 3

2

The program jvisualvm is most just run on your CentOS box. On this box, there is the X Server Host running, and the Reflection X is just a X Server client. Meaning that you are essentially running a remote controlled desktop. All your Windows machine is doing with Reflection X is connecting to the CentOS box to allow you to see and interact with the apps running there.

2

X is very different from Java. It is not a VM, hardware abstraction layer, or anything like that – it's a network protocol, currently at version X11, which programs use to communicate with an X11 server. Such programs can be written in practically any language as long as it has the needed functions.

The X11 server usually runs on your own machine and performs the job of displaying graphics on screen and sending keyboard and mouse events back to the programs. Programs (X11 clients) connect to it locally using such IPC methods (Unix sockets), or over the network – using direct TCP/IP (rare) or tunnelled inside a SSH connection (the "X11 forwarding" option in PuTTY).

Reflection X is a commercial X11 server for Windows. Open-source alternatives include Cygwin/X (a port of Xorg), as well as Xming. Almost every Linux or BSD PC runs Xorg as its main graphics system.

When you run Reflection X on your computer, it just sits there waiting for connections. When you run jvisualvm on the CentOS machine, the profiler connects to the X11 server (tunnelled over the same SSH connection that PuTTY is using) and uses the X11 protocol to open a window and draw inside it.

0
  • Reflection X appears to be an X-Server which runs under MS Windows. A free alternative would be Xming
  • X-Servers serve GUI client requests and display them on the host machine running the X-Server
  • On your Linux box, you'll need to set DISPLAY to point to your X-Server once it is up & running on your windows machine. Then you can launch the GUI app from within your Linux server & it'll display on your Windows desktop.

Nifty eh?

Alternatively if the Linux box is a VMware VM, you could install VMware tools & use their unity app to do something similar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .