How The Game Is Played

http://blogs.sun.com/gameguy/date/20080613 Friday June 13, 2008

Fun with Project Darkstar and JMX

Hey All,

This is just a sort of a random update, but I thought it was neat enough to share. I'm currently multi-tasking and one of the projects I'm working on is the server side of a complete casual game example for Project Darkstar. It is our intent to show it at the AUstin Game Developers Conference in september and release it as open source for other developers to take and modify.

As part of the demo w wanted to be able to peek under the hood at what the app was doing while it was running. After some poking around (and a pointer from a co-worker) I discovered that Java 6 has a *wonderful* tool built in called JConsole.

It is a complete, extensible, JMX viewer you can fire up and just attach to your VM. For anyone who doesn't know, JMX is the monitoring API for Java. You get all sorts of useful VM stats like memory consumption and number of current threads, but the best thing is that extensibility. By writing very little code you can expose your own information to the Console!

For my demo I have written a little Project Darkstar service thats starts an MXBean and registers it and then handles data requests from thw NMXBean. A service is necessary because the data comes from a Project Dakrstar managed object and you need to be able to run transactional code to read a Managed Object. I will be posting the actual code in tghe next day or so, its remarkably small and simple!

Comments:

If you liked JConsole you will probably like VisualVM (https://visualvm.dev.java.net/)..

Dmitri

Posted by Dmitri Trembovetski on June 12, 2008 at 12:28 AM EDT #

No braces this time: https://visualvm.dev.java.net

Posted by Dmitri Trembovetski on June 12, 2008 at 12:29 AM EDT #

Post a Comment:
Comments are closed for this entry.