Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

JVM server mode

Thread view: 
infinite1600@yahoo.com - 24 Oct 2005 10:37 GMT
Can anyone confirm the best mechanism to check if a JVM is running in
server mode without having to trawl through the application's log
files?

Also, does 1.4.2.x always by default startup in client mode unless
"-server" is the first JVM option? Does invoking a JVM in -D64 mode
automatically mean it starts in server mode?

Thanks

A
Skip - 24 Oct 2005 11:30 GMT
> Can anyone confirm the best mechanism to check if a JVM is running in
> server mode without having to trawl through the application's log
> files?

String s = System.getProperty("java.vm.name");
// s = Java HotSpot(TM) Server VM

> Also, does 1.4.2.x always by default startup in client mode unless
> "-server" is the first JVM option? Does invoking a JVM in -D64 mode
> automatically mean it starts in server mode?

The 32-bit JRE (any version) doesn't even have the Server VM.
infinite1600@yahoo.com - 24 Oct 2005 11:52 GMT
> > Can anyone confirm the best mechanism to check if a JVM is running in
> > server mode without having to trawl through the application's log
> > files?
>
> String s = System.getProperty("java.vm.name");
> // s = Java HotSpot(TM) Server VM

Is there no command line mechanism to query the JVM?

> > Also, does 1.4.2.x always by default startup in client mode unless
> > "-server" is the first JVM option? Does invoking a JVM in -D64 mode
> > automatically mean it starts in server mode?
>
> The 32-bit JRE (any version) doesn't even have the Server VM.

Not entirely sure what you mean - the system is running on Solaris 9
(Sparc) and I am assuming it is indeed the 64-bit version. This goes
back to my question of is there any mechanism where you can query the
JVM from command line for finding out if it is in server mode or client
mode.

Thanks
Andrew Thompson - 24 Oct 2005 12:36 GMT
>>>Can anyone confirm the best mechanism to check if a JVM is running in
>>>server mode without having to trawl through the application's log
>>>files?

public class ReportVM {

  public static void main(String[] args) {

>>String s = System.getProperty("java.vm.name");
>>// s = Java HotSpot(TM) Server VM

    System.out.println( s );
  }
}

> Is there no command line mechanism to query the JVM?

java ReportVM

(...duhhh!)
Andrew Thompson - 24 Oct 2005 12:41 GMT
(big snip)

> (...duhhh!)

Oops.  I meant...

;-)
Roedy Green - 24 Oct 2005 13:48 GMT
>Is there no command line mechanism to query the JVM?
just a parameter to set it. -server
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Daniel Sjöblom - 24 Oct 2005 13:51 GMT
> Not entirely sure what you mean - the system is running on Solaris 9
> (Sparc) and I am assuming it is indeed the 64-bit version. This goes
> back to my question of is there any mechanism where you can query the
> JVM from command line for finding out if it is in server mode or client
> mode.

If you use a 1.5 VM, the following tool is probably easiest to use:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jinfo.html

If that doesn't suit your needs, take a look at the other
management/troubleshooting tools:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#manage

If you are stuck with an older VM, you can hook into the VM with a
debugger and get the same kind of info with a little bit of work. Try
jdb for starters:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/jdb.html

(it is available on older JVM:s even though that link points to the 1.5
page).

Hope this helps,
Daniel Sjöblom


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.