If you just want to know if a particular JRE runs as a client or a
server, you can use, e.g., here on a machine that isn't a server-class
machine:

     $ java -version
     java version "1.7.0-ea"
     Java(TM) SE Runtime Environment (build 1.7.0-ea-b16)
     Java HotSpot(TM) Client VM (build 1.7.0-ea-b16, mixed mode, sharing)

If you want to see why a particular JRE decides to run as a server,
you can use the relatively undocumented _JAVA_LAUNCHER_DEBUG environment
variable, e.g., here on a server-class machine:

     $ _JAVA_LAUNCHER_DEBUG=true java -version
     ----_JAVA_LAUNCHER_DEBUG----
     ....
     pages: 262144  page_size: 8192  physical memory: 2147483648 (2.000GB)
     sysconf(_SC_NPROCESSORS_CONF): 2
     unix_sparc_ServerClassMachine: JNI_TRUE
     ServerClassMachine: returns default value of true

which implements the description in

     http://java.sun.com/j2se/1.5.0/docs/guide/vm/server-class.html

Or if you want to look at the code that does that, start from

     
https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/jdk/src/solaris/bin/ergo.c?rev=257&view=markup

and find the machine-dependent ServerClassMachineImpl for Solaris/SPARC
(because it's easy to understand) at

     
https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/jdk/src/solaris/bin/ergo_sparc.c?rev=257&view=markup

The version of ServerClassMachineImpl for Solaris/i586 is in

     
https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/jdk/src/solaris/bin/ergo_i586.c?rev=257&view=markup

and is *much* more exciting.

I'm pointing at the code for what will be JDK-7.  If you are poking at
an older JDK, the code isn't arranged into files quite as nicely, but
the functions are about the same.

I don't know why anything in there would cause DTrace to hang.  It's all
just user-land code.  There is some assembler in the i586 implementation.

                        ... peter

Naveen Nalam wrote:
> Hi,
> 
> This command causes my server to hang:
> dtrace -n 'pid$target::ServerClassMachine:return {printf( "%d\n", arg1) }' -c 
> /usr/bin/java
> 
> I was running this command without any arguments to trace how Java was 
> determining if it should run in client or server VM mode.
> 
> The above command will hang the box either on the 1st execution, or I may 
> have to run the command 4-5 times to get the server to hang. But I can always 
> reproduce it. I thought perhaps it was bad hardware, so I tried on another 
> server with the same specs and also get the hang. This however only hangs my 
> storage servers, all my other server types (compute, web) are fine (which 
> have different hardware config).
> 
> Storage server specs:
> Asus P5M2 mobo
> Marvell MV8 controllers
> 6GB DDR2 DRAM
> Core2 Duo cpu
> Solaris S10 Update 4 with patch 125205-06 (sata fixes)
> 
> There is no crash dump. I also tried booting the kernel with "-k", "set 
> nopanicdebug=1", and "KEYBOARD_ABORT=alternate" -- but couldn't get the 
> kernel to break into the debugger.
> 
> If anyone has some suggestions, I can give them a try.
> 
> Thanks,
> Naveen
> 
> 
> --
> This message posted from opensolaris.org
> _______________________________________________
> dtrace-discuss mailing list
> [email protected]

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to