You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Dominique Petitpierre <Do...@adm.unige.ch> on 2006/01/12 21:59:52 UTC

[jsvc] jsvc does not use the server JVM

Hello,

jsvc does not use the server JVM with java 1.5 on a server-class
machine.

In my context (cf Annexe below, commands 1#, 2#, 3#), regardless if
jsvc is started with (4#, 5#) or without the option "-jvm server", the
process is linked to the client JVM dynamic library (6#), and "jmap
-heap" reports a client JVM (10#, 11#).
Also, the options "-Xms512M -Xmx1000M" have no effect when jsvc is
started with "-jvm server" (10#).
Moreover, in that case, jmap crashes with an exception when reporting
heap statistics (10#) (but not when that option is not used (11#)).

There is no problem when the application is started with "java"
instead of jsvc: it uses the server JVM by default because the machine
is of server class (bi-processor, 2Gb RAM), cf 3#.

- What can I do to make jsvc use the server JVM?

Context (1#, 2#, 3#):
Sun V210 bi-processor (sparc), 2Gb RAM computer, Solaris 9, java
1.5.0_04, jsvc compiled from the 1.0.1 commons daemon distribution:
http://www.apache.org/dist/jakarta/commons/daemon/source/daemon-1.0.1.tar.gz


I also noticed that, with jsvc, the tools "jps" and "jstat" don't
function properly (8#, 9#) (no problem with "java").

Thanks in advance for your hints!

Best regards,
Dominique Petitpierre
--
* Unsolicited commercial email is NOT welcome at this address. *
Mr Dominique Petitpierre       Email: User@Domain
Division Informatique                 User=Dominique.Petitpierre
University of Geneva                  Domain=adm.unige.ch

Annexes: output of various commands showing the context and the
problem

1# uname -srpi
SunOS 5.9 sparc SUNW,Sun-Fire-V210


2# java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Server VM (build 1.5.0_04-b05, mixed mode)

3# java -help |& sed -n -e '/client/,/^$/p'
    -client       to select the "client" VM
    -server       to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is server, 
                  because you are running on a server-class machine.


4# /etc/init.d/tomcat start
12/01/2006 20:27:44 28601 jsvc debug: +-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------
12/01/2006 20:27:44 28601 jsvc debug: | Detach:          True
12/01/2006 20:27:44 28601 jsvc debug: | Show Version:    No
12/01/2006 20:27:44 28601 jsvc debug: | Show Help:       No
12/01/2006 20:27:44 28601 jsvc debug: | Check Only:      Disabled
12/01/2006 20:27:44 28601 jsvc debug: | Stop:            False
12/01/2006 20:27:44 28601 jsvc debug: | Wait:            0
12/01/2006 20:27:44 28601 jsvc debug: | Run as service:  No
12/01/2006 20:27:44 28601 jsvc debug: | Install service: No
12/01/2006 20:27:44 28601 jsvc debug: | Remove service:  No
12/01/2006 20:27:44 28601 jsvc debug: | JVM Name:        "server"
12/01/2006 20:27:44 28601 jsvc debug: | Java Home:       "/usr/local/java"
12/01/2006 20:27:44 28601 jsvc debug: | PID File:        "/var/run/jsvc.pid"
12/01/2006 20:27:44 28601 jsvc debug: | User Name:       "tomcat"
12/01/2006 20:27:44 28601 jsvc debug: | Extra Options:   11
12/01/2006 20:27:44 28601 jsvc debug: |   "-Xms512M"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Xmx1000M"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Dcatalina.home=/usr/local/tomcat"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Dcatalina.base=/usr/local/tomcat"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djava.io.tmpdir=/usr/local/tomcat/temp"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djavax.net.ssl.trustStore=/etc/tomcat/truststore.jks"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djavax.net.ssl.trustStorePassword=changeit"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Dcom.sun.jndi.ldap.connect.pool.debug=all"
12/01/2006 20:27:44 28601 jsvc debug: |   "-Djava.class.path=/usr/local/java/lib/tools.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/commons-logging-api.jar:/usr/local/tomcat/bin/bootstrap.jar"
12/01/2006 20:27:44 28601 jsvc debug: | Class Invoked:   "org.apache.catalina.startup.Bootstrap"
12/01/2006 20:27:44 28601 jsvc debug: | Class Arguments: 0
12/01/2006 20:27:44 28601 jsvc debug: +-------------------------------------------------------
12/01/2006 20:27:44 28602 jsvc debug: user changed to 'tomcat'
12/01/2006 20:27:44 28601 jsvc debug: User 'tomcat' validated
12/01/2006 20:27:44 28601 jsvc debug: Attempting to locate Java Home in /usr/local/java
12/01/2006 20:27:44 28601 jsvc debug: Attempting to locate VM configuration file /usr/local/java/jre/lib/jvm.cfg
12/01/2006 20:27:44 28601 jsvc debug: Attempting to locate VM configuration file /usr/local/java/lib/jvm.cfg
12/01/2006 20:27:44 28601 jsvc debug: Attempting to locate VM configuration file /usr/local/java/jre/lib/sparc/jvm.cfg
12/01/2006 20:27:44 28601 jsvc debug: Found VM configuration file at /usr/local/java/jre/lib/sparc/jvm.cfg
12/01/2006 20:27:44 28601 jsvc debug: Found VM client definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/client/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Found VM server definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/server/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Found VM hotspot definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/hotspot/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/lib/sparc/hotspot/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Cannot locate library for VM hotspot (skipping)
12/01/2006 20:27:44 28601 jsvc debug: Found VM classic definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/classic/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/lib/sparc/classic/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Cannot locate library for VM classic (skipping)
12/01/2006 20:27:44 28601 jsvc debug: Found VM native definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/native/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/lib/sparc/native/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Cannot locate library for VM native (skipping)
12/01/2006 20:27:44 28601 jsvc debug: Found VM green definition in configuration
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/jre/lib/sparc/green/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Checking library /usr/local/java/lib/sparc/green/libjvm.so
12/01/2006 20:27:44 28601 jsvc debug: Cannot locate library for VM green (skipping)
12/01/2006 20:27:44 28601 jsvc debug: Java Home located in /usr/local/java
12/01/2006 20:27:44 28601 jsvc debug: +-- DUMPING JAVA HOME STRUCTURE ------------------------
12/01/2006 20:27:44 28601 jsvc debug: | Java Home:       "/usr/local/java"
12/01/2006 20:27:44 28601 jsvc debug: | Java VM Config.: "/usr/local/java/jre/lib/sparc/jvm.cfg"
12/01/2006 20:27:44 28601 jsvc debug: | Found JVMs:      2
12/01/2006 20:27:44 28601 jsvc debug: | JVM Name:        "client"
12/01/2006 20:27:44 28601 jsvc debug: |                  "/usr/local/java/jre/lib/sparc/client/libjvm.so"
12/01/2006 20:27:44 28601 jsvc debug: | JVM Name:        "server"
12/01/2006 20:27:44 28601 jsvc debug: |                  "/usr/local/java/jre/lib/sparc/server/libjvm.so"
12/01/2006 20:27:44 28601 jsvc debug: +-------------------------------------------------------
12/01/2006 20:27:44 28603 jsvc debug: redirecting stdout to /usr/local/tomcat/logs/catalina.out and stderr to &1

5# pargs `pgrep -o jsvc`
28603:  /usr/local/tomcat/bin/jsvc -jvm server -debug -Xms512M -Xmx1000M -user tomcat -
argv[0]: /usr/local/tomcat/bin/jsvc
argv[1]: -jvm
argv[2]: server
argv[3]: -debug
argv[4]: -Xms512M
argv[5]: -Xmx1000M
argv[6]: -user
argv[7]: tomcat
argv[8]: -home
argv[9]: /usr/local/java
argv[10]: -Dcatalina.home=/usr/local/tomcat
argv[11]: -Dcatalina.base=/usr/local/tomcat
argv[12]: -Djava.io.tmpdir=/usr/local/tomcat/temp
argv[13]: -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed
argv[14]: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
argv[15]: -outfile
argv[16]: /usr/local/tomcat/logs/catalina.out
argv[17]: -errfile
argv[18]: &1
argv[19]: -Djavax.net.ssl.trustStore=/etc/tomcat/truststore.jks
argv[20]: -Djavax.net.ssl.trustStorePassword=changeit
argv[21]: -Dcom.sun.jndi.ldap.connect.pool.debug=all
argv[22]: -cp
argv[23]: /usr/local/java/lib/tools.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/commons-logging-api.jar:/usr/local/tomcat/bin/bootstrap.jar
argv[24]: org.apache.catalina.startup.Bootstrap

6# lsof -p `pgrep -n jsvc` | egrep 'sparc/(client|server)'
jsvc    16899 tomcat  txt   VREG          85,5   6674672 140887 /export/system/usr/local/jdk1.5.0_04/jre/lib/sparc/client/libjvm.so

7# ps -fp `pgrep -n jsvc`
     UID   PID  PPID  C    STIME TTY      TIME CMD
  tomcat 27378 27377  0 20:10:30 ?        0:38 /usr/local/tomcat/bin/jsvc -debug -jvm server -Xms512M -Xmx1000M -user tomcat -

8# jps           27807 Jps
27378 -- process information unavailable
8988 

9# jstat -gc `pgrep -n jsvc` 2 2
27378 not found

10# jmap -heap `pgrep -n jsvc` 
Attaching to process ID 27378, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 1.5.0_04-b05

using thread-local object allocation.
Mark Sweep Compact GC

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 67108864 (64.0MB)
   NewSize          = 2228224 (2.125MB)
   MaxNewSize       = 4294967295 (4095.9999990463257MB)
   OldSize          = 1441792 (1.375MB)
   NewRatio         = 8
   SurvivorRatio    = 32
   PermSize         = 8388608 (8.0MB)
   MaxPermSize      = 67108864 (64.0MB)

Heap Usage:
Exception in thread "main" java.lang.RuntimeException: unknown heap type : class sun.jvm.hotspot.gc_interface.CollectedHeap
        at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:105)
        at sun.jvm.hotspot.tools.JMap.run(JMap.java:71)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
        at sun.jvm.hotspot.tools.JMap.main(JMap.java:99)



# same except without "-jvm server" option:

11# jmap -heap `pgrep -n jsvc`
Attaching to process ID 28209, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 1.5.0_04-b05

using thread-local object allocation.
Mark Sweep Compact GC

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 1048576000 (1000.0MB)
   NewSize          = 2228224 (2.125MB)
   MaxNewSize       = 4294901760 (4095.9375MB)
   OldSize          = 1441792 (1.375MB)
   NewRatio         = 8
   SurvivorRatio    = 32
   PermSize         = 8388608 (8.0MB)
   MaxPermSize      = 67108864 (64.0MB)

Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 58195968 (55.5MB)
   used     = 21053960 (20.07862091064453MB)
   free     = 37142008 (35.42137908935547MB)
   36.17769533449465% used
Eden Space:
   capacity = 56492032 (53.875MB)
   used     = 21053960 (20.07862091064453MB)
   free     = 35438072 (33.79637908935547MB)
   37.268901922310036% used
>From Space:
   capacity = 1703936 (1.625MB)
   used     = 0 (0.0MB)
   free     = 1703936 (1.625MB)
   0.0% used
To Space:
   capacity = 1703936 (1.625MB)
   used     = 0 (0.0MB)
   free     = 1703936 (1.625MB)
   0.0% used
tenured generation:
   capacity = 477233152 (455.125MB)
   used     = 7526768 (7.1780853271484375MB)
   free     = 469706384 (447.94691467285156MB)
   1.5771678829219309% used
Perm Generation:
   capacity = 14680064 (14.0MB)
   used     = 14461008 (13.791091918945312MB)
   free     = 219056 (0.2089080810546875MB)
   98.50779942103794% used

12# which jmap jps jstat
/usr/local/java/bin/jmap
/usr/local/java/bin/jps
/usr/local/java/bin/jstat

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jsvc] jsvc does not use the server JVM

Posted by Russell Simpkins <ru...@hotmail.com>.
>| Java VM Config.: "/usr/local/java/jre/lib/sparc/jvm.cfg"
>| Found JVMs:      2
>| JVM Name:        "client"
>|                  "/usr/local/java/jre/lib/sparc/client/libjvm.so"
>| JVM Name:        "server"
>|                  "/usr/local/java/jre/lib/sparc/server/libjvm.so"
>

according to these docs 
(http://tomcat.apache.org/tomcat-5.0-doc/setup.html):
------------------------
Before running the script, the JAVA_HOME environment variable should be set 
to the base path of the JDK. Alternately, when calling the ./configure 
script, the path of the JDK may be specified using the --with-java 
parameter, such as ./configure --with-java=/usr/java.
------------------------
Note that is says "JDK," which would indicate the Java Development Kit and 
not the Java Runtime Environment. It might be worth a shot to recompile 
using: --with-java=/usr/java where the JDK is installed, vs /usr/java/jre, 
where the Java Runtime is installed. If you don't use --with-java, it will 
pick up the java_home variable. jstat etc aren't even in the jre/bin 
directory.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jsvc] jsvc does not use the server JVM

Posted by Dominique Petitpierre <Do...@adm.unige.ch>.
Hello,

Thanks for your comments:

On 12.01.2006 22:23, Russell Simpkins wrote:
>> jsvc does not use the server JVM with java 1.5 on a server-class
>> machine.
> 
> i've not used jsvc, so don't flame me if i'm off.
> 
> double check what params you used when building jsvc. According to the 
> readme, you can configure with   ./configure --with-java=/usr/java where 
> /usr/java is the location of your jvm.

That is how jsvc was compiled. And I doubled check before posting:
the java version specified for compiling is the the same as
the java version used when running jsvc: 1.5.0_04-b05

> I think maybe it's picking up a 
> jvm that does not support the -server argument, which would make sense.

In the annexe of my message, you can see in the debug output of jsvc
that it knows it should use the server JVM:

| JVM Name:        "server" 

and that it does find the server and the client JVMs:

| Java VM Config.: "/usr/local/java/jre/lib/sparc/jvm.cfg"
| Found JVMs:      2
| JVM Name:        "client"
|                  "/usr/local/java/jre/lib/sparc/client/libjvm.so"
| JVM Name:        "server"
|                  "/usr/local/java/jre/lib/sparc/server/libjvm.so"


> you may have better luck posting to the tomcat mailing lists.

I don't see how the application (in this case jakarta-tomcat-5.5.9)
could affect the problem I described: if it is run with "java" it uses
the server JVM, if it is run with "jsvc" it uses the client JVM
whatever the options given to jsvc.  The problems with jmap, jps and
jstat are also related to jsvc.

- Has anybody else encountered a similar problem?

But you are right: posting in the tomcat mailing list will reach a
larger audience of jsvc users. 


Best regards,
Dominique Petitpierre
--
* Unsolicited commercial email is NOT welcome at this address. *
Mr Dominique Petitpierre       Email: User@Domain
Division Informatique                 User=Dominique.Petitpierre
University of Geneva                  Domain=adm.unige.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: [jsvc] jsvc does not use the server JVM

Posted by Russell Simpkins <ru...@hotmail.com>.
>jsvc does not use the server JVM with java 1.5 on a server-class
>machine.
i've not used jsvc, so don't flame me if i'm off.

double check what params you used when building jsvc. According to the 
readme, you can configure with   ./configure --with-java=/usr/java where 
/usr/java is the location of your jvm. I think maybe it's picking up a jvm 
that does not support the -server argument, which would make sense.

you may have better luck posting to the tomcat mailing lists.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org