In JDK1.3, try
java -Xrunhprof:help
run()
method in ptolemy.actor.Manager so that
System.out.println(new Date()).getTime())
is called
at the start and the end of the run()
method.
You may also need to include the following at the top with the other import statements.
import java.util.Date;
http://help.netscape.com/kb/consumer/19970907-1.html
says
To troubleshoot your Java applets in UNIX environment, you can start Communicator with the "-java" switch. #netscape -java Usage: -java [-options] class where options include: -help print out this message -version print out the build version -v -verbose turn on verbose mode -debug enable remote JAVA debugging -noasyncgc don't allow asynchronous garbage collection -verbosegc print a message when garbage collection occurs -noclassgc disable class garbage collection -cs -checksource check if source is newer when loading classes -ss<number> set the maximum native stack size for any thread -oss<number> set the maximum Java stack size for any thread -ms<number> set the initial Java heap size -mx<number> set the maximum Java heap size -D<name>=<value> set a system property -classpath <directories separated by ':'> list directories in which to look for classes -prof[:<file>] output profiling data to ./java.prof or ./<file> -verify verify all classes when read in -verifyremote verify classes read in over the network [default] -noverify do not verify any class
And
http://help.netscape.com/kb/consumer/19970907-2.html
You can automatically startup the Java Virtual Machine as you launch Communicator. This will prevent Communicator from restarting the Java Virtual Machine each time you browse pages that have Java applets or audio files played by the liveaudio plugin. The command to use is : "C:\Program Files\Netscape\Communicator\Program\netscape.exe" -start_java You can edit the properties of your start icon of the Communicator to add the option. You can also start the messenger (or other component) the same way by : "C:\Program Files\Netscape\Communicator\Program\netscape.exe" -start_java -mail Note: This doesn't seem to work on NT3.51
Java has a garbage collector, which helps, but memory leaks are still possible. Usually, an object is marked as being eligible for GC when it goes out of scope. Or, if the value of the object is null, then it may be GC'd. However, an object will not be garbage collected if the object has references to it. This is how we get memory leaks.
We can ask that the garbage collector be run with
System.gc();For example, we do this in the code generator after building the large AST that represents the java.lang and ptolemy.kernel classes.
Finalization is what happens before an object is GC'd. We
can force the system to run the finalize
method
on all objects that are waiting to be finalized with:
System.runFinalization();For further information, see Java Tutorial Page about Garbage Collection and IBM page about memory leaks
java
command takes non-standard
commands like -Xmxsize
to set the maximum stack
size. For example, under Cygwin, to run with a 256 megabyte heap size:
export JAVAFLAGS=-Xmx256m $PTII/bin/vergilTo see what other
-X
commands are available, run
java -X
See the JDC Book that discusses Heap Analysis Tool for downloads and further information.
Generate a hprof file:
java -Xrunhprof:file=vergil.hprof,format=b -classpath $PTII/lib/diva.jar\;$PTII/ptolemy/vergil/vergil.jar\;$PTII/ptolemy/ptolemy.jar\;$PTII ptolemy.vergil.VergilApplication
Run HAT: java -classpath hat.zip\;$PTII/lib/diva.jar\;$PTII/ptolemy/vergil/vergil.jar\;$PTII/ptolemy/ptolemy.jar\;$PTII -mx100m hat.Main vergil.hprof
Last Updated: $Date: 2004/06/18 00:11:41 $