There were some questions about the memory consumption of the application server on the Creator Forum. That’s especially interesting when you try to develop applications which might be used by numerous clients at a time.

So I decided to take all the pieces together and try it. You need:

  • The latest release of Netbeans 5 and it’s profiler pack.  Right now, that’s NB 5 RC2. But the release should happen “very soon now”;-)
  • Of course, you need Java Studio Creator 2😉
  • A bigger box with a big screen is helpful;-) My dual Opteron/2GB W2100z did not mind the extra load too much;-)

Now develop your application in Creator as you normally would and deploy it at least once. That deployment is needed to make sure, all the configuration is done to the application server and Creator does not try to restart the server while it’s running in profile mode.

Start Netbeans and find the Runtime tab. Use the Add Server … context menu action of the Servers node to tell Netbeans where it will find Creator’s application server. That action will open a wizard to ask for all the necessary information.  On the first page, select Sun Java System Application Server and give the new server a name. On the next page, enter the path to the Creator application server.  For me that was “/export/home/marco/rave/Creator2/SunAppServer8”. After a little while, the default domain creator should be filled in.  On the next page, enter the admin user name and password (that is admin/adminadmin by default) and hit finish. Now you should see a new node under Servers with your choosen name.

Right click and stop that server.  Then start it in Profile Mode again. Now select Profile -> Attach Profiler …   from the menubar. Now select one profile task from the wizard (Monitor Application is fine for the beginning) and hit >–> Attach. The application server will continue to start up and you will see thread and memory information in the NetBeans profiler. Once the application server is up and running and you are more interested in a particular task, you can modify the profiling tasks on the fly (to switch to memory profiling for instance). See the NB Profiler page for more info.

Back in Creator, you can now deploy or redeploy your application and use the browser to navigate it.  NB will show you what the application server is doing.

Screen Shot

The screen shot above shows Creator 2, FireFox as browser and NetBeans 5.0rc2 with the profiler while I was trying to find memory problems in a DB application.

I hope this will help a bit;-)

Have fun,
— Marco