swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JVM profiling agent & Sun JDK


From: glen e. p. ropella
Subject: JVM profiling agent & Sun JDK
Date: Wed, 26 Jan 2000 11:28:18 -0800



I just thought I'd document a trick.  If you're using the
Java layer to Swarm, you can get profiling data (with java 2,
at any rate) by running the model with the HPROF agent.
(I won't tell you how to run it in order to encourage you to
download it and read the source code:
http://web2.java.sun.com/products/jdk/1.2/docs/guide/jvmpi/jvmpi.html)

But, in order for the agent to collect the data, the
hprof_jvm_shut_down_event has to be thrown.  Currently,
the only way that will happen in a Swarm/Java hybrid is
if you hit the quit button while the simulation is running
(i.e. not in the ControlStateStopped state).  So, if you
want to use the profiling agent that comes with java 2,
then don't stop the simulation by hitting the "Stop"
button and then the "Quit" button on the default ControlPanel
(a.k.a. ProcCtrl)... Simply hit the "Quit" button while
the thing is running.

Of course, this only opens up the opportunity for the
jvm_shut_down event.  The trick is to put System.exit(0);
in a drop method in your topLevelSwarm so that when drop
gets called, you can forcibly kill the java vm.  But,
the necessity of this is dependent on how you've structured
your model.

Or, better yet, don't use the ControlPanel at all and design
a Java-side control panel, then submit it for inclusion in
Swarm.

glen
p.s. I plan to both fix the ObjC ControlPanel and write a
Java-side controller; but, my record with contributions since
I left the project has been pretty poor.
--
glen e. p. ropella =><= Feeding the hamster wheel.  Hail Eris!
Home: http://www.swarm.com/gepr                (505) 424-0448
Work: http://www.swarm.com                      (505) 995-0818

                 ==================================
  Swarm-Support is for discussion of the technical details of the day
  to day usage of Swarm.  For list administration needs (esp.
  [un]subscribing), please send a message to <address@hidden>
  with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]