Stephen Martin wrote:
> 
> Ok, so i've got my application written and packaged into a jar file
> and it's ready to ship. What is the best way to use it in the target
> system? Just running java my.class sparks up a 77 Meg 1.2 jvm on
> my system which seems pretty heavy weight for a simple application.
> I'm aware of the -Xms and -Xmx options but have no idea what are good
> values for these. I'm also aware of other jvm's such as kaffe but
> have no idea what the difference is between regular java and personal
> java.
> 
> So my question is this, given a fairly simple java app (ie no native
> methods, no rmi, no jdbc...). What is the best way for an end user
> to run it without having it hog all the resources on their system.
> 

On UNIX systems, you can use a shell script to set environment
variables, call the JVM, and pass command-line flags to it. You can also
use JNI to create a small native executable that instantiates the JVM
with arguments. See
http://java.sun.com/docs/books/tutorial/native1.1/index.html and follow
that trail for instructions on how to do it. 

In regards to setting minimum and maximum stack sizes, a "good value" is
really dependent on your application. If you're doing alot of file IO or
very intense computations, you might want to set those numbers fairly
high. The only way to really determine how much memory to explicitly
allocate to your application's VM is to experiment with different
settings. It seems to me that most folks usually use around 64 MB as the
max size. Your mileage may vary.



-- 
Jeff Galyan
http://www.anamorphic.com
http://www.sun.com
jeffrey dot galyan at sun dot com
talisman at anamorphic dot com
Sun Certified Java(TM) Programmer
======================================================================
Linus Torvalds on Microsoft and software development:
"... if it's a hobby for me and a job for you, why are you doing such a
shoddy job of it?"

The views expressed herein do not necessarily reflect those of my
employer.

Sun Microsystems, Inc., has no connection to my involvement with the
Mozilla Organization.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to